diff options
| author | Martin <mhaug@live.de> | 2021-06-18 13:01:55 +0200 |
|---|---|---|
| committer | Martin <mhaug@live.de> | 2021-06-18 13:01:55 +0200 |
| commit | 80a9b300d1acb8821ac0600aad3d2135ad9587bd (patch) | |
| tree | 6626ba8891fa4db4e3a1cb13f7f4b27fc05989bf /src/layout/grid.rs | |
| parent | 7db78d83bedf62adea0d715c9a2a179ce23a1a48 (diff) | |
Ref count the frames
Diffstat (limited to 'src/layout/grid.rs')
| -rw-r--r-- | src/layout/grid.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/layout/grid.rs b/src/layout/grid.rs index e426d695..d2976502 100644 --- a/src/layout/grid.rs +++ b/src/layout/grid.rs @@ -32,7 +32,7 @@ impl Layout for GridNode { &self, ctx: &mut LayoutContext, regions: &Regions, - ) -> Vec<Constrained<Frame>> { + ) -> Vec<Constrained<Rc<Frame>>> { // Prepare grid layout by unifying content and gutter tracks. let mut layouter = GridLayouter::new(self, regions.clone()); @@ -78,7 +78,7 @@ struct GridLayouter<'a> { /// Constraints for the active region. constraints: Constraints, /// Frames for finished regions. - finished: Vec<Constrained<Frame>>, + finished: Vec<Constrained<Rc<Frame>>>, } /// Produced by initial row layout, auto and linear rows are already finished, @@ -314,7 +314,7 @@ impl<'a> GridLayouter<'a> { } /// Layout the grid row-by-row. - fn layout(mut self, ctx: &mut LayoutContext) -> Vec<Constrained<Frame>> { + fn layout(mut self, ctx: &mut LayoutContext) -> Vec<Constrained<Rc<Frame>>> { for y in 0 .. self.rows.len() { match self.rows[y] { TrackSizing::Auto => { @@ -497,7 +497,7 @@ impl<'a> GridLayouter<'a> { }; let main = frame.size.get(self.main); - output.push_frame(pos.to_point(self.main), frame); + output.merge_frame(pos.to_point(self.main), frame); pos.main += main; } |
