summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--core/src/border.rs14
2 files changed, 14 insertions, 1 deletions
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<u16>` and `From<i32>` 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)
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)
}
}