diff options
| author | Martin <mhaug@live.de> | 2022-01-01 12:56:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-01 12:56:03 +0100 |
| commit | 28fc2893e873d44aa31a64a87cb3e2e975977a70 (patch) | |
| tree | bad022650bb488492386e4fc079dde3807b89304 /src/library/align.rs | |
| parent | 5d5d8a21cfc041ab08d30229f4ecb4cbb415cbc5 (diff) | |
| parent | 179a9f479831c4941253c0517fccdec3acd8f2ff (diff) | |
Merge pull request #53 from typst/style-chains
Diffstat (limited to 'src/library/align.rs')
| -rw-r--r-- | src/library/align.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/library/align.rs b/src/library/align.rs index 5f21fa37..32735244 100644 --- a/src/library/align.rs +++ b/src/library/align.rs @@ -8,7 +8,7 @@ pub fn align(_: &mut EvalContext, args: &mut Args) -> TypResult<Value> { let aligns: Spec<_> = args.find().unwrap_or_default(); let body: PackedNode = args.expect("body")?; - let mut styles = Styles::new(); + let mut styles = StyleMap::new(); if let Some(align) = aligns.x { styles.set(ParNode::ALIGN, align); } @@ -50,13 +50,14 @@ impl Layout for AlignNode { &self, ctx: &mut LayoutContext, regions: &Regions, + styles: StyleChain, ) -> Vec<Constrained<Rc<Frame>>> { // The child only needs to expand along an axis if there's no alignment. let mut pod = regions.clone(); pod.expand &= self.aligns.map_is_none(); // Layout the child. - let mut frames = self.child.layout(ctx, &pod); + let mut frames = self.child.layout(ctx, &pod, styles); for ((current, base), Constrained { item: frame, cts }) in regions.iter().zip(&mut frames) |
