diff options
author | 2024-02-21 07:10:29 +0100 | |
---|---|---|
committer | 2024-02-21 07:10:29 +0100 | |
commit | 950a7f7eaf4afaaa7492e6227bef81b238a526a8 (patch) | |
tree | 445f1fd086cd4cc421abd5dd507041c7ca2ca278 /core | |
parent | c0c5a01079b39a1d831f0a80d6f2ee7f539a1673 (diff) | |
download | iced-950a7f7eaf4afaaa7492e6227bef81b238a526a8.tar.gz iced-950a7f7eaf4afaaa7492e6227bef81b238a526a8.tar.bz2 iced-950a7f7eaf4afaaa7492e6227bef81b238a526a8.zip |
Add `From<u16>` and `From<i32>` for `border::Radius`
Diffstat (limited to 'core')
-rw-r--r-- | core/src/border.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/core/src/border.rs b/core/src/border.rs index 21823341..64262471 100644 --- a/core/src/border.rs +++ b/core/src/border.rs @@ -37,7 +37,19 @@ impl From<f32> for Radius { impl From<u8> for Radius { fn from(w: u8) -> Self { - Self([f32::from(w); 4]) + Self::from(f32::from(w)) + } +} + +impl From<u16> for Radius { + fn from(w: u16) -> Self { + Self::from(f32::from(w)) + } +} + +impl From<i32> for Radius { + fn from(w: i32) -> Self { + Self::from(w as f32) } } |