Add placeholder methods for recommended sizes

This commit is contained in:
2024-06-11 17:12:18 -04:00
parent 1069ae6455
commit 95d3dc3288
3 changed files with 32 additions and 1 deletions

View File

@@ -42,6 +42,7 @@ func (contract Contract) MinimumSize (hints tomo.LayoutHints, boxes []tomo.Box)
}
func (contract Contract) Arrange (hints tomo.LayoutHints, boxes []tomo.Box) {
// TODO if we overflow in a direction, respect the reccomended size
if contract.v() {
dot := hints.Bounds.Min
for index, box := range boxes {
@@ -93,5 +94,15 @@ func (contract Contract) Arrange (hints tomo.LayoutHints, boxes []tomo.Box) {
}
}
func (contract Contract) RecommendedHeight (hints tomo.LayoutHints, boxes []tomo.Box, width int) int {
// TODO
return 0
}
func (contract Contract) RecommendedWidth (hints tomo.LayoutHints, boxes []tomo.Box, height int) int {
// TODO
return 0
}
func (contract Contract) v () bool { return contract == ContractVertical }
func (contract Contract) h () bool { return contract == ContractHorizontal }