BoxQuerier returns box minimum size as a fallback for reccomended sizes

This commit is contained in:
Sasha Koshka 2024-07-27 02:17:56 -04:00
parent 832d7e02ef
commit 33969f45e9

View File

@ -20,6 +20,7 @@ func (querier boxQuerier) RecommendedWidth (index int, height int) int {
if box, ok := box.(anyContentBox); ok {
return box.recommendedWidth(height)
}
return box.minimumSize().X
}
return 0
}
@ -29,6 +30,7 @@ func (querier boxQuerier) RecommendedHeight (index int, width int) int {
if box, ok := box.(anyContentBox); ok {
return box.recommendedHeight(width)
}
return box.minimumSize().Y
}
return 0
}