mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-02 16:06:19 +00:00
ui/layout: restore Flex.Rigid behaviour
Broken by 5f2adf9b2f.
Clamp to 0 while we're here.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+4
-1
@@ -81,7 +81,10 @@ func (f *Flex) begin(mode flexMode) {
|
||||
func (f *Flex) Rigid() Constraints {
|
||||
f.begin(modeRigid)
|
||||
mainc := axisMainConstraint(f.Axis, f.cs)
|
||||
mainMax := mainc.Max
|
||||
mainMax := mainc.Max - f.size
|
||||
if mainMax < 0 {
|
||||
mainMax = 0
|
||||
}
|
||||
return axisConstraints(f.Axis, Constraint{Max: mainMax}, axisCrossConstraint(f.Axis, f.cs))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user