diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-03-11 10:48:29 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-03-11 10:48:29 +0100 |
| commit | c1b1dbcc0925ba1730fabbfbca3c8b99831c5561 (patch) | |
| tree | 6e4cb30753729c699bd899a7f2ec352e276beee8 /src/exec/mod.rs | |
| parent | 4e5f85aa4ac0d6b51323bb2a6e1fbd3f4f46babb (diff) | |
Better expansion behaviour 🐪
This makes expansion behaviour inheritable by placing it into the area and passing it down during layouting instead of computing some approximation of what we want during execution.
Diffstat (limited to 'src/exec/mod.rs')
| -rw-r--r-- | src/exec/mod.rs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/exec/mod.rs b/src/exec/mod.rs index ea2c90f4..79ad81e7 100644 --- a/src/exec/mod.rs +++ b/src/exec/mod.rs @@ -11,8 +11,7 @@ use std::rc::Rc; use crate::diag::Pass; use crate::env::Env; use crate::eval::{ExprMap, TemplateFunc, TemplateNode, Value, ValueTemplate}; -use crate::geom::Spec; -use crate::layout::{self, Expansion, NodeSpacing, NodeStack}; +use crate::layout::{self, NodeFixed, NodeSpacing, NodeStack}; use crate::pretty::pretty; use crate::syntax::*; @@ -120,11 +119,17 @@ impl Exec for NodeRaw { ctx.apply_parbreak(); } - ctx.push(NodeStack { - dirs: ctx.state.dirs, - align: ctx.state.align, - expand: Spec::uniform(Expansion::Fit), - children, + // This is wrapped in a fixed node to make sure the stack fits to its + // content instead of filling the available area. + ctx.push(NodeFixed { + width: None, + height: None, + child: NodeStack { + dirs: ctx.state.dirs, + align: ctx.state.align, + children, + } + .into(), }); if self.block { |
