summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-09 06:38:48 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-09 06:38:48 +0100
commitf3ae4266e9727940ba0d0e8469362923590916f4 (patch)
tree2a6871b981c083fe01b90511b58f510da7ed9ce2 /core
parentab236376a3f8f1ac3cdd8aeb0ffeee45e3de37e3 (diff)
downloadiced-f3ae4266e9727940ba0d0e8469362923590916f4.tar.gz
iced-f3ae4266e9727940ba0d0e8469362923590916f4.tar.bz2
iced-f3ae4266e9727940ba0d0e8469362923590916f4.zip
Implement `From<u32>` instead of `u16` for `Length` and `Pixels`
Diffstat (limited to 'core')
-rw-r--r--core/src/length.rs6
-rw-r--r--core/src/pixels.rs6
2 files changed, 6 insertions, 6 deletions
diff --git a/core/src/length.rs b/core/src/length.rs
index 5f24169f..363833c4 100644
--- a/core/src/length.rs
+++ b/core/src/length.rs
@@ -77,8 +77,8 @@ impl From<f32> for Length {
}
}
-impl From<u16> for Length {
- fn from(units: u16) -> Self {
- Length::Fixed(f32::from(units))
+impl From<u32> for Length {
+ fn from(units: u32) -> Self {
+ Length::Fixed(units as f32)
}
}
diff --git a/core/src/pixels.rs b/core/src/pixels.rs
index 7d6267cf..c87e2b31 100644
--- a/core/src/pixels.rs
+++ b/core/src/pixels.rs
@@ -20,9 +20,9 @@ impl From<f32> for Pixels {
}
}
-impl From<u16> for Pixels {
- fn from(amount: u16) -> Self {
- Self(f32::from(amount))
+impl From<u32> for Pixels {
+ fn from(amount: u32) -> Self {
+ Self(amount as f32)
}
}