Fix block child spacing
This commit is contained in:
parent
1e5a100d6a
commit
a73149767c
@ -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;
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 21 KiB |
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user