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:
parent
581d67398a
commit
9fc570c4be
9 changed files with 120 additions and 56 deletions
|
@ -1067,7 +1067,7 @@ fn full_path_budget(
|
|||
small_em: Pixels,
|
||||
max_width: Pixels,
|
||||
) -> usize {
|
||||
((px(max_width / px(0.8)) - px(file_name.len() as f32) * normal_em) / small_em) as usize
|
||||
(((max_width / 0.8) - file_name.len() * normal_em) / small_em) as usize
|
||||
}
|
||||
|
||||
impl PickerDelegate for FileFinderDelegate {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue