diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-02-02 15:25:43 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-02-02 15:25:43 +0100 |
| commit | 0a1916c1e4259aff1306b26c06d4edcf0f190a3b (patch) | |
| tree | 8ab81f034dd8b392b368691a2d55349f5c798d85 /src/library/grid.rs | |
| parent | bdb1c008f2cee7c3929b671d9407d2b578182199 (diff) | |
Remove width from backlog and last region
Diffstat (limited to 'src/library/grid.rs')
| -rw-r--r-- | src/library/grid.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/library/grid.rs b/src/library/grid.rs index c49ac84f..6a9b790a 100644 --- a/src/library/grid.rs +++ b/src/library/grid.rs @@ -386,9 +386,10 @@ impl<'a> GridLayouter<'a> { // Determine the size for each region of the row. for (x, &rcol) in self.rcols.iter().enumerate() { if let Some(node) = self.cell(x, y) { - // All widths should be `rcol` except the base for auto columns. let mut pod = self.regions.clone(); - pod.mutate(|size| size.x = rcol); + pod.current.x = rcol; + + // All widths should be `rcol` except the base for auto columns. if self.cols[x] == TrackSizing::Auto { pod.base.x = self.regions.base.x; } @@ -513,18 +514,15 @@ impl<'a> GridLayouter<'a> { // Prepare regions. let size = Size::new(self.used.x, heights[0]); let mut pod = Regions::one(size, self.regions.base, Spec::splat(true)); - pod.backlog = heights[1 ..] - .iter() - .map(|&h| Size::new(self.used.x, h)) - .collect::<Vec<_>>() - .into_iter(); + pod.backlog = heights[1 ..].to_vec().into_iter(); // Layout the row. let mut pos = Point::zero(); for (x, &rcol) in self.rcols.iter().enumerate() { if let Some(node) = self.cell(x, y) { + pod.current.x = rcol; + // All widths should be `rcol` except the base for auto columns. - pod.mutate(|size| size.x = rcol); if self.cols[x] == TrackSizing::Auto { pod.base.x = self.regions.base.x; } |
