From fd1fa859983382680319390f177301f8a7bc2480 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 15 Oct 2019 21:18:02 +0200 Subject: [PATCH] layout: allow Expand children to fill the available area Signed-off-by: Elias Naur --- layout/stack.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layout/stack.go b/layout/stack.go index 0f9737a0..858dcad3 100644 --- a/layout/stack.go +++ b/layout/stack.go @@ -44,8 +44,8 @@ func (s *Stack) Expand(gtx *Context, w Widget) StackChild { var m op.MacroOp m.Record(gtx.Ops) cs := Constraints{ - Width: Constraint{Min: s.maxSZ.X, Max: s.maxSZ.X}, - Height: Constraint{Min: s.maxSZ.Y, Max: s.maxSZ.Y}, + Width: Constraint{Min: s.maxSZ.X, Max: gtx.Constraints.Width.Max}, + Height: Constraint{Min: s.maxSZ.Y, Max: gtx.Constraints.Height.Max}, } dims := gtx.Layout(cs, w) m.Stop()