summaryrefslogtreecommitdiff
path: root/library/src/layout/container.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-02-12 16:56:51 +0100
committerLaurenz <laurmaedje@gmail.com>2023-02-12 17:28:17 +0100
commitf4856c18b9cf3f6952276cc61b557aebeb2fa651 (patch)
treebf96d2e6d9c154c1e2603c096ff9d6f39db0e217 /library/src/layout/container.rs
parent697ae1f925f1be80b34c1da697ba8db7327a6b61 (diff)
Remove base width
Diffstat (limited to 'library/src/layout/container.rs')
-rw-r--r--library/src/layout/container.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/library/src/layout/container.rs b/library/src/layout/container.rs
index 094ed05a..b7e7aa18 100644
--- a/library/src/layout/container.rs
+++ b/library/src/layout/container.rs
@@ -77,24 +77,22 @@ impl Layout for BoxNode {
let size = self
.sizing
.resolve(styles)
- .zip(regions.base)
+ .zip(regions.base())
.map(|(s, b)| s.map(|v| v.relative_to(b)))
- .unwrap_or(regions.first);
+ .unwrap_or(regions.size);
// Select the appropriate base and expansion for the child depending
// on whether it is automatically or relatively sized.
let is_auto = self.sizing.as_ref().map(Option::is_none);
- let base = is_auto.select(regions.base, size);
let expand = regions.expand | !is_auto;
-
- Regions::one(size, base, expand)
+ Regions::one(size, expand)
};
// Layout the child.
let mut frame = self.body.layout(vt, styles, pod)?.into_frame();
// Ensure frame size matches regions size if expansion is on.
- let target = regions.expand.select(regions.first, frame.size());
+ let target = regions.expand.select(regions.size, frame.size());
frame.resize(target, Align::LEFT_TOP);
Ok(Fragment::frame(frame))