diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-12-05 12:54:03 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-12-05 12:54:03 +0100 |
| commit | 26bdc1f0f6fe8113d7fcfb4d5aca46aa5238ccd8 (patch) | |
| tree | 4c12a187032501735d858648a64fe66603f106a6 /src/library/shape.rs | |
| parent | 738ff7e1f573bef678932b313be9969a17af8d22 (diff) | |
Set Rules Episode I: The Phantom Style
Diffstat (limited to 'src/library/shape.rs')
| -rw-r--r-- | src/library/shape.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/library/shape.rs b/src/library/shape.rs index 61c0d6e3..c83a1c49 100644 --- a/src/library/shape.rs +++ b/src/library/shape.rs @@ -76,20 +76,18 @@ fn shape_impl( } // The shape's contents. - let body = args.find::<Template>(); + let body = args.find::<Node>(); - Ok(Value::Template(Template::from_inline(move |style| { + Ok(Value::inline( ShapeNode { kind, fill, stroke, - child: body - .as_ref() - .map(|body| body.pack(style).padded(Sides::splat(padding))), + child: body.map(|body| body.into_block().padded(Sides::splat(padding))), } .pack() - .sized(Spec::new(width, height)) - }))) + .sized(Spec::new(width, height)), + )) } /// Places its child into a sizable and fillable shape. |
