~eliasnaur/gio

8425d2a6aa8bf0998b53c3694fb13abe08b2f927 — Elias Naur 9 months ago a55065a
layout: ensure Flex{Alignment: Middle} respects minimum constraint

Before this change, the middle alignment would align according to
the widest child. This change aligns according to the widest child
or minimum constraint, whichever is largest.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
1 files changed, 1 insertions(+), 1 deletions(-)

M layout/flex.go
M layout/flex.go => layout/flex.go +1 -1
@@ 142,7 142,7 @@ func (f Flex) Layout(gtx Context, children ...FlexChild) Dimensions {
		children[i].call = c
		children[i].dims = dims
	}
	var maxCross int
	maxCross := crossMin
	var maxBaseline int
	for _, child := range children {
		if c := f.Axis.Convert(child.dims.Size).Y; c > maxCross {