diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-11-29 13:12:50 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-11-29 13:12:50 +0100 |
| commit | cae60ea0cc818b570435c92d081f734109c9c52e (patch) | |
| tree | fa1711ce7a156f645b70c45d8eba37294e8a449c /src | |
| parent | e36b8ed374423816876273f30b77eee38cb8b74c (diff) | |
Go back to wrapping inline nodes
Diffstat (limited to 'src')
| -rw-r--r-- | src/eval/template.rs | 2 | ||||
| -rw-r--r-- | src/library/pad.rs | 2 | ||||
| -rw-r--r-- | src/library/sized.rs | 6 |
3 files changed, 4 insertions, 6 deletions
diff --git a/src/eval/template.rs b/src/eval/template.rs index d447161a..9c57bbf3 100644 --- a/src/eval/template.rs +++ b/src/eval/template.rs @@ -151,7 +151,7 @@ impl Template { /// Pack the template into a layout node. pub fn pack(&self, style: &Style) -> PackedNode { - if let [TemplateNode::Block(f) | TemplateNode::Inline(f)] = self.0.as_slice() { + if let [TemplateNode::Block(f)] = self.0.as_slice() { f(style) } else { let mut builder = Builder::new(style, false); diff --git a/src/library/pad.rs b/src/library/pad.rs index 4bd7fd64..05cc30b7 100644 --- a/src/library/pad.rs +++ b/src/library/pad.rs @@ -15,7 +15,7 @@ pub fn pad(_: &mut EvalContext, args: &mut Args) -> TypResult<Value> { bottom.or(all).unwrap_or_default(), ); - Ok(Value::Template(Template::from_inline(move |style| { + Ok(Value::Template(Template::from_block(move |style| { body.pack(style).padded(padding) }))) } diff --git a/src/library/sized.rs b/src/library/sized.rs index daf2b407..dfdc721d 100644 --- a/src/library/sized.rs +++ b/src/library/sized.rs @@ -10,13 +10,11 @@ pub fn box_(_: &mut EvalContext, args: &mut Args) -> TypResult<Value> { }))) } -/// `block`: Size content and place it into the flow. +/// `block`: Place content into the flow. pub fn block(_: &mut EvalContext, args: &mut Args) -> TypResult<Value> { - let width = args.named("width")?; - let height = args.named("height")?; let body: Template = args.find().unwrap_or_default(); Ok(Value::Template(Template::from_block(move |style| { - body.pack(style).sized(Spec::new(width, height)) + body.pack(style) }))) } |
