Last visibile item in StackPanel is now clipped to maximum available area.

This commit is contained in:
Sander Schobers 2021-07-19 17:55:43 +02:00
parent de8ce3e7bc
commit 12a9f5ee39

View File

@ -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
}