From 1c7467c4bcc638cd1c80b84c66864be99c032d57 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 10 Jan 2023 22:27:25 -0500 Subject: [PATCH] Fixed bug with vertical layout being cringe --- elements/layouts/vertical.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/elements/layouts/vertical.go b/elements/layouts/vertical.go index c61b99b..3e3741a 100644 --- a/elements/layouts/vertical.go +++ b/elements/layouts/vertical.go @@ -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() } }