diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-02-22 12:42:02 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-02-22 12:42:02 +0100 |
| commit | 2bf32c51bceb2f3a8b7ebea3d7c7d6d96757591b (patch) | |
| tree | 3524388a7394dd35ccef10b89a7a034e6ae1ab60 /src/library/align.rs | |
| parent | c7e52f20483971a39f54c56700b31980f744a410 (diff) | |
Remove layout cache
Diffstat (limited to 'src/library/align.rs')
| -rw-r--r-- | src/library/align.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/library/align.rs b/src/library/align.rs index a7e6d3cb..8ea9ddaf 100644 --- a/src/library/align.rs +++ b/src/library/align.rs @@ -27,7 +27,7 @@ impl Layout for AlignNode { vm: &mut Vm, regions: &Regions, styles: StyleChain, - ) -> TypResult<Vec<Constrained<Arc<Frame>>>> { + ) -> TypResult<Vec<Arc<Frame>>> { // The child only needs to expand along an axis if there's no alignment. let mut pod = regions.clone(); pod.expand &= self.aligns.map_is_none(); @@ -40,20 +40,13 @@ impl Layout for AlignNode { // Layout the child. let mut frames = self.child.layout(vm, &pod, passed.chain(&styles))?; - for ((current, base), Constrained { item: frame, cts }) in - regions.iter().zip(&mut frames) - { + for (region, frame) in regions.iter().zip(&mut frames) { // Align in the target size. The target size depends on whether we // should expand. - let target = regions.expand.select(current, frame.size); + let target = regions.expand.select(region, frame.size); let default = Spec::new(Align::Left, Align::Top); let aligns = self.aligns.unwrap_or(default); Arc::make_mut(frame).resize(target, aligns); - - // Set constraints. - cts.expand = regions.expand; - cts.base = base.filter(cts.base.map_is_some()); - cts.exact = current.filter(regions.expand | cts.exact.map_is_some()); } Ok(frames) |
