diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-02-17 15:47:54 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-02-17 17:32:56 +0100 |
| commit | c5e67af22bd6242366819879be84c10c4dd135be (patch) | |
| tree | d857b99b26401d1b3b74c4cebacbf086c25bef40 /src/library/flow.rs | |
| parent | 3d965ae6a479636a13b2e2f2344e8d97bedece1f (diff) | |
Merge eval and layout contexts into `Vm`
Diffstat (limited to 'src/library/flow.rs')
| -rw-r--r-- | src/library/flow.rs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/library/flow.rs b/src/library/flow.rs index ca554033..95469b65 100644 --- a/src/library/flow.rs +++ b/src/library/flow.rs @@ -28,7 +28,7 @@ pub enum FlowChild { impl Layout for FlowNode { fn layout( &self, - ctx: &mut LayoutContext, + vm: &mut Vm, regions: &Regions, styles: StyleChain, ) -> Vec<Constrained<Arc<Frame>>> { @@ -56,7 +56,7 @@ impl Layout for FlowNode { layouter.layout_spacing(*kind); } FlowChild::Node(ref node) => { - layouter.layout_node(ctx, node, styles); + layouter.layout_node(vm, node, styles); } } } @@ -161,12 +161,7 @@ impl FlowLayouter { } /// Layout a node. - pub fn layout_node( - &mut self, - ctx: &mut LayoutContext, - node: &LayoutNode, - styles: StyleChain, - ) { + pub fn layout_node(&mut self, vm: &mut Vm, node: &LayoutNode, styles: StyleChain) { // Don't even try layouting into a full region. if self.regions.is_full() { self.finish_region(); @@ -176,7 +171,7 @@ impl FlowLayouter { // aligned later. if let Some(placed) = node.downcast::<PlaceNode>() { if placed.out_of_flow() { - let frame = node.layout(ctx, &self.regions, styles).remove(0); + let frame = node.layout(vm, &self.regions, styles).remove(0); self.items.push(FlowItem::Placed(frame.item)); return; } @@ -193,7 +188,7 @@ impl FlowLayouter { .unwrap_or(Align::Top), ); - let frames = node.layout(ctx, &self.regions, styles); + let frames = node.layout(vm, &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. |
