summaryrefslogtreecommitdiff
path: root/src/library/graphics/shape.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-04-08 15:08:26 +0200
committerLaurenz <laurmaedje@gmail.com>2022-04-08 15:45:14 +0200
commit712c00ecb72b67da2c0788e5d3eb4dcc6366b2a7 (patch)
treef5d7ef4341a4728c980d020cc173fa6bb70feaff /src/library/graphics/shape.rs
parent977ac77e6a3298be2644a8231e93acbef9f7f396 (diff)
Em units
Diffstat (limited to 'src/library/graphics/shape.rs')
-rw-r--r--src/library/graphics/shape.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/library/graphics/shape.rs b/src/library/graphics/shape.rs
index 9faa4c52..ec6f735b 100644
--- a/src/library/graphics/shape.rs
+++ b/src/library/graphics/shape.rs
@@ -26,14 +26,15 @@ impl<const S: ShapeKind> ShapeNode<S> {
/// How to stroke the shape.
pub const STROKE: Smart<Option<Paint>> = Smart::Auto;
/// The stroke's thickness.
- pub const THICKNESS: Length = Length::pt(1.0);
+ #[property(resolve)]
+ pub const THICKNESS: RawLength = Length::pt(1.0).into();
/// How much to pad the shape's content.
- pub const PADDING: Relative<Length> = Relative::zero();
+ pub const PADDING: Relative<RawLength> = Relative::zero();
fn construct(_: &mut Context, args: &mut Args) -> TypResult<Content> {
let size = match S {
- SQUARE => args.named::<Length>("size")?.map(Relative::from),
- CIRCLE => args.named::<Length>("radius")?.map(|r| 2.0 * Relative::from(r)),
+ SQUARE => args.named::<RawLength>("size")?.map(Relative::from),
+ CIRCLE => args.named::<RawLength>("radius")?.map(|r| 2.0 * Relative::from(r)),
_ => None,
};