ui/layout: don't stretch Align child

Let the caller decide whether the constraints should be stretched.

Also unexport Constraint (not Constraints) methods, they weren't
pulling their weight.

Finally, don't force cross axis constraint minimum to 0 in List.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-11 09:18:56 +02:00
parent dbe15b23a9
commit 896f5a77dd
2 changed files with 15 additions and 18 deletions
+1 -4
View File
@@ -217,11 +217,8 @@ func (l *List) Layout() Dimens {
func (l *List) crossConstraintChild(cs Constraints) Constraint {
c := axisCrossConstraint(l.Axis, cs)
switch l.CrossAxisAlignment {
case Stretch:
if l.CrossAxisAlignment == Stretch {
c.Min = c.Max
default:
c.Min = 0
}
return c
}