From 950a7f7eaf4afaaa7492e6227bef81b238a526a8 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 21 Feb 2024 07:10:29 +0100 Subject: Add `From` and `From` for `border::Radius` --- core/src/border.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 for Radius { impl From for Radius { fn from(w: u8) -> Self { - Self([f32::from(w); 4]) + Self::from(f32::from(w)) + } +} + +impl From for Radius { + fn from(w: u16) -> Self { + Self::from(f32::from(w)) + } +} + +impl From for Radius { + fn from(w: i32) -> Self { + Self::from(w as f32) } } -- cgit From 65f36f246a0f16e627c8a2ee5c02b4533e2dd2d7 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 21 Feb 2024 07:11:40 +0100 Subject: Update `CHANGELOG` --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bea24a28..0ff082fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `PartialOrd`, `Ord`, and `Hash` implementations for `keyboard::Modifiers`. [#2270](https://github.com/iced-rs/iced/pull/2270) - `clipboard` module in `advanced` module. [#2272](https://github.com/iced-rs/iced/pull/2272) - Default `disabled` style for `checkbox` and `hovered` style for `Svg`. [#2273](https://github.com/iced-rs/iced/pull/2273) +- `From` and `From` implementations for `border::Radius`. [#2274](https://github.com/iced-rs/iced/pull/2274) ### Fixed - Black images when using OpenGL backend in `iced_wgpu`. [#2259](https://github.com/iced-rs/iced/pull/2259) -- cgit