diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-08-17 12:49:48 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-08-17 12:49:48 +0200 |
| commit | c53d98a22f367a9eecfb45d1b22f1be5c6cf908d (patch) | |
| tree | ac319fa1b53d659bc021f5ebfd85b868f982a922 /src/library/elements.rs | |
| parent | 9a798ce6f6e734a02764473891632c071fed41ee (diff) | |
More logical ordering and naming
Diffstat (limited to 'src/library/elements.rs')
| -rw-r--r-- | src/library/elements.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/library/elements.rs b/src/library/elements.rs index 1ad56a81..f4577084 100644 --- a/src/library/elements.rs +++ b/src/library/elements.rs @@ -24,7 +24,7 @@ pub fn image(ctx: &mut EvalContext, args: &mut Arguments) -> TypResult<Value> { })?; Ok(Value::template(move |ctx| { - ctx.push_into_par(ImageNode { id, width, height }) + ctx.inline(ImageNode { id, width, height }) })) } @@ -62,19 +62,19 @@ fn rect_impl( body: Template, ) -> Value { Value::template(move |ctx| { - let mut stack = ctx.exec_template_stack(&body); + let mut stack = ctx.exec_template(&body); stack.aspect = aspect; let fixed = FixedNode { width, height, child: stack.into() }; if let Some(fill) = fill { - ctx.push_into_par(BackgroundNode { + ctx.inline(BackgroundNode { shape: BackgroundShape::Rect, fill: Paint::Color(fill), child: fixed.into(), }); } else { - ctx.push_into_par(fixed); + ctx.inline(fixed); } }) } @@ -117,7 +117,7 @@ fn ellipse_impl( // perfectly into the ellipse. const PAD: f64 = 0.5 - SQRT_2 / 4.0; - let mut stack = ctx.exec_template_stack(&body); + let mut stack = ctx.exec_template(&body); stack.aspect = aspect; let fixed = FixedNode { @@ -131,13 +131,13 @@ fn ellipse_impl( }; if let Some(fill) = fill { - ctx.push_into_par(BackgroundNode { + ctx.inline(BackgroundNode { shape: BackgroundShape::Ellipse, fill: Paint::Color(fill), child: fixed.into(), }); } else { - ctx.push_into_par(fixed); + ctx.inline(fixed); } }) } |
