diff options
Diffstat (limited to 'tui/layout.go')
| -rw-r--r-- | tui/layout.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tui/layout.go b/tui/layout.go index 3b70881..9dea37d 100644 --- a/tui/layout.go +++ b/tui/layout.go @@ -146,7 +146,10 @@ func (b *Box) computeChildrenSizes(axis int) { } func (b *Box) solve(axis int) { - if b.Dir.axis() == axis && !b.Overflow { + switch { + case b.Dir.axis() == axis && b.Overflow: + break + case b.Dir.axis() == axis: size := b.marginsSize(axis) nFlexible := 0 for _, c := range b.children { @@ -178,7 +181,7 @@ func (b *Box) solve(axis int) { c.computedSize[axis] -= shave excess -= shave } - } else { + default: maxSize := b.computedSize[axis] - b.marginsSize(axis) for _, c := range b.children { c.computedSize[axis] = min(c.computedSize[axis], maxSize) |
