diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-02-22 14:31:09 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-02-23 14:53:55 +0100 |
| commit | e1f29d6cb9437a4afb2e4fc4ee10a5b8717ab9fa (patch) | |
| tree | 1ce5f2bd858f6665d3867a2939d4b474c1b70377 /src/library/stack.rs | |
| parent | 2bf32c51bceb2f3a8b7ebea3d7c7d6d96757591b (diff) | |
Rework the core context
Diffstat (limited to 'src/library/stack.rs')
| -rw-r--r-- | src/library/stack.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/library/stack.rs b/src/library/stack.rs index 6768a0a0..8e463f6a 100644 --- a/src/library/stack.rs +++ b/src/library/stack.rs @@ -16,7 +16,7 @@ pub struct StackNode { #[class] impl StackNode { - fn construct(_: &mut Vm, args: &mut Args) -> TypResult<Template> { + fn construct(_: &mut Context, args: &mut Args) -> TypResult<Template> { Ok(Template::block(Self { dir: args.named("dir")?.unwrap_or(Dir::TTB), spacing: args.named("spacing")?, @@ -28,7 +28,7 @@ impl StackNode { impl Layout for StackNode { fn layout( &self, - vm: &mut Vm, + ctx: &mut Context, regions: &Regions, styles: StyleChain, ) -> TypResult<Vec<Arc<Frame>>> { @@ -48,7 +48,7 @@ impl Layout for StackNode { layouter.layout_spacing(kind); } - layouter.layout_node(vm, node, styles)?; + layouter.layout_node(ctx, node, styles)?; deferred = self.spacing; } } @@ -165,7 +165,7 @@ impl StackLayouter { /// Layout an arbitrary node. pub fn layout_node( &mut self, - vm: &mut Vm, + ctx: &mut Context, node: &LayoutNode, styles: StyleChain, ) -> TypResult<()> { @@ -179,7 +179,7 @@ impl StackLayouter { .and_then(|node| node.aligns.get(self.axis)) .unwrap_or(self.dir.start().into()); - let frames = node.layout(vm, &self.regions, styles)?; + let frames = node.layout(ctx, &self.regions, styles)?; let len = frames.len(); for (i, frame) in frames.into_iter().enumerate() { // Grow our size, shrink the region and save the frame for later. |
