diff --git a/library/src/layout/container.rs b/library/src/layout/container.rs index ef5fbe5dd..9bf1bf872 100644 --- a/library/src/layout/container.rs +++ b/library/src/layout/container.rs @@ -362,6 +362,10 @@ impl Layout for BlockElem { pod.size.x = size.x; pod.expand = expand; + if expand.y { + pod.full = size.y; + } + // Generate backlog for fixed height. let mut heights = vec![]; if sizing.y.is_custom() { @@ -375,6 +379,10 @@ impl Layout for BlockElem { } } + if let Some(last) = heights.last_mut() { + *last += remaining; + } + pod.size.y = heights[0]; pod.backlog = &heights[1..]; pod.last = None; diff --git a/tests/ref/layout/container.png b/tests/ref/layout/container.png index f016385b7..0cd56b2df 100644 Binary files a/tests/ref/layout/container.png and b/tests/ref/layout/container.png differ diff --git a/tests/typ/layout/container.typ b/tests/typ/layout/container.typ index 8a711b10d..8d4ec34b2 100644 --- a/tests/typ/layout/container.typ +++ b/tests/typ/layout/container.typ @@ -10,7 +10,16 @@ Spaced \ Apart --- -// Test box sizing. +// Test block sizing. +#set page(height: 120pt) +#set block(spacing: 0pt) +#block(width: 90pt, height: 80pt, fill: red)[ + #block(width: 60%, height: 60%, fill: green) + #block(width: 50%, height: 60%, fill: blue) +] + +--- +// Test box sizing with layoutable child. #box( width: 50pt, height: 50pt,