WIP: preserve aspect ratio of images

This commit is contained in:
Antonio Scandurra 2023-11-28 17:32:27 +01:00
parent 600b564bbf
commit 3ac545088a
4 changed files with 87 additions and 58 deletions

View file

@ -905,6 +905,12 @@ impl From<Pixels> for usize {
}
}
impl From<usize> for Pixels {
fn from(pixels: usize) -> Self {
Pixels(pixels as f32)
}
}
#[derive(
Add, AddAssign, Clone, Copy, Default, Div, Eq, Hash, Ord, PartialEq, PartialOrd, Sub, SubAssign,
)]