From 10ef4576e7de31a3a16c66808b7461b15b965905 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 11 Jul 2019 19:15:17 +0200 Subject: [PATCH] ui/layout: drop Flex.MainAxisSize setting and MainAxisSize type The setting doesn't bear its own weight; it's simpler for the client to adjust the constraints itself. Signed-off-by: Elias Naur --- ui/layout/flex.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/ui/layout/flex.go b/ui/layout/flex.go index bfacbdee..8d86bc0f 100644 --- a/ui/layout/flex.go +++ b/ui/layout/flex.go @@ -13,7 +13,6 @@ type Flex struct { Axis Axis MainAxisAlignment MainAxisAlignment CrossAxisAlignment CrossAxisAlignment - MainAxisSize MainAxisSize ops *ui.Ops cs Constraints @@ -29,18 +28,11 @@ type FlexChild struct { dims Dimens } -type MainAxisSize uint8 - type MainAxisAlignment uint8 type CrossAxisAlignment uint8 type flexMode uint8 -const ( - Max MainAxisSize = iota - Min -) - const ( Start = 100 + iota End @@ -136,11 +128,7 @@ func (f *Flex) Layout(children ...FlexChild) Dimens { mainc := axisMainConstraint(f.Axis, f.cs) crossSize := axisCrossConstraint(f.Axis, f.cs).Constrain(f.maxCross) var space int - if mainc.Max != ui.Inf && f.MainAxisSize == Max { - if mainc.Max > f.size { - space = mainc.Max - f.size - } - } else if mainc.Min > f.size { + if mainc.Min > f.size { space = mainc.Min - f.size } var mainSize int