Remove Pixels: Mul<Pixels, Output = Pixels> impl, add ScaledPixels ops (#27451)

It doesn't make sense to have `Pixels: Mul<Pixels, Output = Pixels>` as
the output should be `Pixels^2` (area), so these impls are removed. All
code where these impls were used are improved by instead multiplying by
`f32` or `usize`.

Also adds math op impls that are present for `Pixels` but absent for
`ScaledPixels`. Adds missing `Mul<Pixels> for usize` to both.

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-03-25 13:34:26 -06:00 committed by GitHub
parent 581d67398a
commit 9fc570c4be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 120 additions and 56 deletions

View file

@ -172,10 +172,10 @@ mod uniform_list {
.map(|layout| RenderedIndentGuide {
bounds: Bounds::new(
point(
px(layout.offset.x as f32) * self.indent_size,
px(layout.offset.y as f32) * item_height,
layout.offset.x * self.indent_size,
layout.offset.y * item_height,
),
size(px(1.), px(layout.length as f32) * item_height),
size(px(1.), layout.length * item_height),
),
layout,
is_active: false,