diff options
Diffstat (limited to 'src/library/columns.rs')
| -rw-r--r-- | src/library/columns.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/library/columns.rs b/src/library/columns.rs index bae23dd3..3ce9b6e5 100644 --- a/src/library/columns.rs +++ b/src/library/columns.rs @@ -18,7 +18,7 @@ impl ColumnsNode { /// The size of the gutter space between each column. pub const GUTTER: Linear = Relative::new(0.04).into(); - fn construct(_: &mut Vm, args: &mut Args) -> TypResult<Template> { + fn construct(_: &mut Context, args: &mut Args) -> TypResult<Template> { Ok(Template::block(Self { columns: args.expect("column count")?, child: args.expect("body")?, @@ -29,14 +29,14 @@ impl ColumnsNode { impl Layout for ColumnsNode { fn layout( &self, - vm: &mut Vm, + ctx: &mut Context, regions: &Regions, styles: StyleChain, ) -> TypResult<Vec<Arc<Frame>>> { // Separating the infinite space into infinite columns does not make // much sense. if regions.first.x.is_infinite() { - return self.child.layout(vm, regions, styles); + return self.child.layout(ctx, regions, styles); } // Determine the width of the gutter and each column. @@ -52,14 +52,13 @@ impl Layout for ColumnsNode { .chain(regions.backlog.as_slice()) .flat_map(|&height| std::iter::repeat(height).take(columns)) .skip(1) - .collect::<Vec<_>>() - .into_iter(), + .collect(), last: regions.last, expand: Spec::new(true, regions.expand.y), }; // Layout the children. - let mut frames = self.child.layout(vm, &pod, styles)?.into_iter(); + let mut frames = self.child.layout(ctx, &pod, styles)?.into_iter(); let dir = styles.get(ParNode::DIR); let total_regions = (frames.len() as f32 / columns as f32).ceil() as usize; @@ -108,7 +107,7 @@ pub struct ColbreakNode; #[class] impl ColbreakNode { - fn construct(_: &mut Vm, _: &mut Args) -> TypResult<Template> { + fn construct(_: &mut Context, _: &mut Args) -> TypResult<Template> { Ok(Template::Colbreak) } } |
