diff --git a/layouts/grid.go b/layouts/grid.go index 4943a72..5c423ff 100644 --- a/layouts/grid.go +++ b/layouts/grid.go @@ -106,15 +106,14 @@ func expand (hints tomo.LayoutHints, sizes []int, space int, expands func (int) } func ceilDiv (x, y int) int { + if y == 0 { return 0 } return int(math.Ceil(float64(x) / float64(y))) } func (this *Grid) RecommendedHeight (hints tomo.LayoutHints, boxes []tomo.Box, width int) int { - // TODO - return 0 + return this.MinimumSize(hints, boxes).Y } func (this *Grid) RecommendedWidth (hints tomo.LayoutHints, boxes []tomo.Box, height int) int { - // TODO - return 0 + return this.MinimumSize(hints, boxes).X }