From 80a9b300d1acb8821ac0600aad3d2135ad9587bd Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 18 Jun 2021 13:01:55 +0200 Subject: Ref count the frames --- src/layout/stack.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/layout/stack.rs') diff --git a/src/layout/stack.rs b/src/layout/stack.rs index b45adcb2..2a0b2806 100644 --- a/src/layout/stack.rs +++ b/src/layout/stack.rs @@ -32,7 +32,7 @@ impl Layout for StackNode { &self, ctx: &mut LayoutContext, regions: &Regions, - ) -> Vec> { + ) -> Vec>> { StackLayouter::new(self, regions.clone()).layout(ctx) } } @@ -64,9 +64,9 @@ struct StackLayouter<'a> { constraints: Constraints, /// Offset, alignment and frame for all children that fit into the current /// region. The exact positions are not known yet. - frames: Vec<(Length, Gen, Frame)>, + frames: Vec<(Length, Gen, Rc)>, /// Finished frames for previous regions. - finished: Vec>, + finished: Vec>>, } impl<'a> StackLayouter<'a> { @@ -98,7 +98,7 @@ impl<'a> StackLayouter<'a> { } /// Layout all children. - fn layout(mut self, ctx: &mut LayoutContext) -> Vec> { + fn layout(mut self, ctx: &mut LayoutContext) -> Vec>> { for child in &self.stack.children { match *child { StackChild::Spacing(amount) => self.space(amount), @@ -133,7 +133,7 @@ impl<'a> StackLayouter<'a> { /// Push a frame into the current or next fitting region, finishing regions /// if necessary. - fn push_frame(&mut self, frame: Frame, aligns: Gen) { + fn push_frame(&mut self, frame: Rc, aligns: Gen) { let size = frame.size.to_gen(self.main); // Don't allow `Start` after `End` in the same region. -- cgit v1.2.3