diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-08-19 15:31:29 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-08-19 15:52:15 +0200 |
| commit | a6f260ca39f70f82617eca87855789413715f47d (patch) | |
| tree | 08141ae619bd21e0544d21433bce759aebc7ba83 /src/layout/tree.rs | |
| parent | fdab7158c91c52a4ace211c804fdd8e9110f56de (diff) | |
Refactor layouting a bit
Notably:
- Handle aspect ratio in fixed node
- Inline constraint inflation into pad node
Diffstat (limited to 'src/layout/tree.rs')
| -rw-r--r-- | src/layout/tree.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/layout/tree.rs b/src/layout/tree.rs index 4b21e05c..1899a4d2 100644 --- a/src/layout/tree.rs +++ b/src/layout/tree.rs @@ -4,6 +4,9 @@ use std::any::Any; use std::fmt::{self, Debug, Formatter}; #[cfg(feature = "layout-cache")] +use std::hash::{Hash, Hasher}; + +#[cfg(feature = "layout-cache")] use fxhash::FxHasher64; /// A tree of layout nodes. @@ -37,7 +40,7 @@ impl PageRun { // that axis. let Size { width, height } = self.size; let expand = Spec::new(width.is_finite(), height.is_finite()); - let regions = Regions::repeat(self.size, expand); + let regions = Regions::repeat(self.size, self.size, expand); self.child.layout(ctx, ®ions).into_iter().map(|c| c.item).collect() } } |
