From b0a870aceb5e61992dc02382a9334b7b32049e01 Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Mon, 7 Oct 2024 13:01:03 -0700 Subject: [PATCH] CornerRadii conversion helpers --- src/styles.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/styles.rs b/src/styles.rs index 6826d98..975c9fc 100644 --- a/src/styles.rs +++ b/src/styles.rs @@ -1458,6 +1458,29 @@ impl IntoValue for Dimension { } } +impl IntoValue> for Dimension { + fn into_value(self) -> Value> { + Value::Constant(CornerRadii { + top_left: self, + top_right: self, + bottom_right: self, + bottom_left: self, + }) + } +} + +impl IntoValue> for Lp { + fn into_value(self) -> Value> { + Dimension::Lp(self).into_value() + } +} + +impl IntoValue> for Px { + fn into_value(self) -> Value> { + Dimension::Px(self).into_value() + } +} + impl ScreenScale for Edges where U: ScreenScale,