summaryrefslogtreecommitdiffstats
path: root/core/src/padding.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-11-08 04:11:06 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-11-08 04:11:06 +0100
commit24d031b51c85507199b0e33e44c5a871882f6b32 (patch)
tree298d12b180ff5cf605c815744dec492af2f8f2a9 /core/src/padding.rs
parent914f0993428c752937d8db0a70a48f6f6f29c839 (diff)
downloadiced-24d031b51c85507199b0e33e44c5a871882f6b32.tar.gz
iced-24d031b51c85507199b0e33e44c5a871882f6b32.tar.bz2
iced-24d031b51c85507199b0e33e44c5a871882f6b32.zip
Cast to `u16` first then divide by `2` in `Padding::fit`
Diffstat (limited to 'core/src/padding.rs')
-rw-r--r--core/src/padding.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/padding.rs b/core/src/padding.rs
index ad5d1f0f..8d701f80 100644
--- a/core/src/padding.rs
+++ b/core/src/padding.rs
@@ -79,10 +79,10 @@ impl Padding {
let available = (outer - inner).max(Size::ZERO);
Padding {
- top: self.top.min((available.height / 2.0) as u16),
- right: self.right.min((available.width / 2.0) as u16),
- bottom: self.bottom.min((available.height / 2.0) as u16),
- left: self.left.min((available.width / 2.0) as u16),
+ top: self.top.min((available.height as u16) / 2),
+ right: self.right.min((available.width as u16) / 2),
+ bottom: self.bottom.min((available.height as u16) / 2),
+ left: self.left.min((available.width as u16) / 2),
}
}
}