mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
layout: ensure Spacer obeys constraints
This commit ensures that the Spacer type doesn't break layouts by ignoring when its min constraints require it to be larger or its max constraints require it to be smaller. Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
+2
-2
@@ -211,10 +211,10 @@ type Spacer struct {
|
||||
|
||||
func (s Spacer) Layout(gtx Context) Dimensions {
|
||||
return Dimensions{
|
||||
Size: image.Point{
|
||||
Size: gtx.Constraints.Constrain(image.Point{
|
||||
X: gtx.Dp(s.Width),
|
||||
Y: gtx.Dp(s.Height),
|
||||
},
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user