From f36070f71656b3ccabaa62864311cbae4b6bffb0 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 15 Jul 2019 19:29:42 +0200 Subject: [PATCH] ui/layout: delete Constraints.Expand and Constraints.Loose They're not (yet) shown their use. Signed-off-by: Elias Naur --- ui/layout/layout.go | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/ui/layout/layout.go b/ui/layout/layout.go index ebe8f6a9..b1622374 100644 --- a/ui/layout/layout.go +++ b/ui/layout/layout.go @@ -42,22 +42,6 @@ func (c Constraints) Constrain(p image.Point) image.Point { return image.Point{X: c.Width.Constrain(p.X), Y: c.Height.Constrain(p.Y)} } -func (c Constraints) Expand() Constraints { - return Constraints{Width: c.Width.expand(), Height: c.Height.expand()} -} - -func (c Constraints) Loose() Constraints { - return Constraints{Width: c.Width.loose(), Height: c.Height.loose()} -} - -func (c Constraint) expand() Constraint { - return Constraint{Min: c.Max, Max: c.Max} -} - -func (c Constraint) loose() Constraint { - return Constraint{Max: c.Max} -} - // RigidConstraints returns the constraints that can only be // satisfied by the given dimensions. func RigidConstraints(size image.Point) Constraints { @@ -146,7 +130,9 @@ func (a *Align) Begin(ops *ui.Ops, cs Constraints) Constraints { a.ops = ops a.cs = cs ops.Begin() - return cs.Loose() + cs.Width.Min = 0 + cs.Height.Min = 0 + return cs } func (a *Align) End(dims Dimens) Dimens {