summaryrefslogtreecommitdiff
path: root/src/layout/shape.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-10-16 11:39:26 +0200
committerLaurenz <laurmaedje@gmail.com>2021-10-23 20:22:47 +0200
commit6690bc23545bfe7275ad92de9e6bd11b7345caf4 (patch)
treee116a23f2f04b3053160aae09088830fdb21460f /src/layout/shape.rs
parent1e74f7c407e42174b631cb7477f3c88252da7e25 (diff)
Revise block node contract
Frames produced by block nodes are now always treated as exactly one per given region and a frame must not be larger than its respective region. Any overflow must be handled internally. This means that stack and grid don't need to search for fitting regions anymore, since the child has already does that for them. This commit further moves stack spacing into a new `SpacingNode`.
Diffstat (limited to 'src/layout/shape.rs')
-rw-r--r--src/layout/shape.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/layout/shape.rs b/src/layout/shape.rs
index aa90707c..3469f660 100644
--- a/src/layout/shape.rs
+++ b/src/layout/shape.rs
@@ -46,7 +46,8 @@ impl Layout for ShapeNode {
let mut cts = Constraints::new(regions.expand);
cts.set_base_if_linear(regions.base, Spec::new(self.width, self.height));
- // Set exact and base constraint if child is automatically sized.
+ // Set tight exact and base constraints if the child is
+ // automatically sized since we don't know what the child might do.
if self.width.is_none() {
cts.exact.x = Some(regions.current.w);
cts.base.x = Some(regions.base.w);