diff --git a/ui/stackpanel.go b/ui/stackpanel.go index 6ae42a9..74c5819 100644 --- a/ui/stackpanel.go +++ b/ui/stackpanel.go @@ -42,7 +42,9 @@ func (p *StackPanel) Arrange(ctx Context, bounds geom.RectangleF32, offset geom. height = remainder / float32(stretch) } } - var child = geom.RectF32(bounds.Min.X, bounds.Min.Y+childOffset, bounds.Max.X, bounds.Min.Y+childOffset+height) + minY := geom.Min32(bounds.Max.Y, bounds.Min.Y+childOffset) + maxY := geom.Min32(bounds.Max.Y, bounds.Min.Y+childOffset+height) + var child = geom.RectF32(bounds.Min.X, minY, bounds.Max.X, maxY) p.Children[i].Arrange(ctx, p.Orientation.FlipRect(child), offset, p) childOffset += height }