Use f32 for Padding

This commit is contained in:
Héctor Ramón Jiménez 2023-02-17 16:09:49 +01:00
parent 0872d078e2
commit 3320ac1126
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
12 changed files with 98 additions and 79 deletions

View file

@ -191,7 +191,7 @@ where
}
}
let pad = axis.pack(padding.left as f32, padding.top as f32);
let pad = axis.pack(padding.left, padding.top);
let mut main = pad.0;
for (i, node) in nodes.iter_mut().enumerate() {

View file

@ -114,10 +114,7 @@ impl Limits {
/// Shrinks the current [`Limits`] to account for the given padding.
pub fn pad(&self, padding: Padding) -> Limits {
self.shrink(Size::new(
padding.horizontal() as f32,
padding.vertical() as f32,
))
self.shrink(Size::new(padding.horizontal(), padding.vertical()))
}
/// Shrinks the current [`Limits`] by the given [`Size`].