summaryrefslogtreecommitdiff
path: root/src/library/elements.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-10-10 20:54:13 +0200
committerLaurenz <laurmaedje@gmail.com>2021-10-10 21:04:10 +0200
commit9ac125dea8d6ea6cc01814d04413225845b69d65 (patch)
treec7dabcda703e5f5b2704c67920efc490f2f8fb57 /src/library/elements.rs
parentd4cc8c775d4c579aeac69ca2d212a604c67043b0 (diff)
Rename `State` to `Style` and move it into its own module
Diffstat (limited to 'src/library/elements.rs')
-rw-r--r--src/library/elements.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/library/elements.rs b/src/library/elements.rs
index 9680dfee..51f8dc98 100644
--- a/src/library/elements.rs
+++ b/src/library/elements.rs
@@ -61,12 +61,12 @@ fn rect_impl(
fill: Option<Color>,
body: Template,
) -> Value {
- Value::Template(Template::from_inline(move |state| {
+ Value::Template(Template::from_inline(move |style| {
let mut node = LayoutNode::new(FixedNode {
width,
height,
aspect,
- child: body.to_stack(state).into(),
+ child: body.to_stack(style).into(),
});
if let Some(fill) = fill {
@@ -114,7 +114,7 @@ fn ellipse_impl(
fill: Option<Color>,
body: Template,
) -> Value {
- Value::Template(Template::from_inline(move |state| {
+ Value::Template(Template::from_inline(move |style| {
// This padding ratio ensures that the rectangular padded region fits
// perfectly into the ellipse.
const PAD: f64 = 0.5 - SQRT_2 / 4.0;
@@ -125,7 +125,7 @@ fn ellipse_impl(
aspect,
child: LayoutNode::new(PadNode {
padding: Sides::splat(Relative::new(PAD).into()),
- child: body.to_stack(state).into(),
+ child: body.to_stack(style).into(),
}),
});