diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-12-30 12:12:19 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-12-30 12:12:19 +0100 |
| commit | f174134aa23e96a2121fb4106fb23fbdad4d641a (patch) | |
| tree | 7c842c8af3383805bbc7b835daecc71e8ba616e6 /src/library/align.rs | |
| parent | 5d5d8a21cfc041ab08d30229f4ecb4cbb415cbc5 (diff) | |
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) |
