ConstraintView fixed with negative sizes
This commit is contained in:
parent
e9f5b6687e
commit
768702af0b
@ -25,6 +25,12 @@ func (v *ConstrainView) Constrain(maxWidth, maxHeight int) {
|
||||
}
|
||||
|
||||
func (v *ConstrainView) Layout() (prefWidth, prefHeight int) {
|
||||
if v.View() == nil {
|
||||
return v.MaxWidth, v.MaxHeight
|
||||
}
|
||||
|
||||
vw, vh := v.View().Layout()
|
||||
return min(vw, v.MaxWidth), min(vh, v.MaxHeight)
|
||||
prefWidth = iff(vw >= 0, min(vw, v.MaxWidth), v.MaxWidth)
|
||||
prefHeight = iff(vh >= 0, min(vh, v.MaxHeight), v.MaxHeight)
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user