Fixed bug with vertical layout being cringe

This commit is contained in:
Sasha Koshka 2023-01-10 22:27:25 -05:00
parent 3ddeeb5469
commit 1c7467c4bc
1 changed files with 3 additions and 1 deletions

View File

@ -27,12 +27,14 @@ func (layout Vertical) Arrange (entries []tomo.LayoutEntry, width, height int) {
// count the number of expanding elements and the amount of free space
// for them to collectively occupy
for _, entry := range entries {
for index, entry := range entries {
if entry.Expand {
expandingElements ++
} else {
_, entryMinHeight := entry.MinimumSize()
freeSpace -= entryMinHeight
}
if index > 0 {
freeSpace -= theme.Padding()
}
}