From 1efb94695365eaff3b0e4926b574dd4b6e263e00 Mon Sep 17 00:00:00 2001 From: "sashakoshka@tebibyte.media" Date: Sat, 22 Jun 2024 15:38:52 -0400 Subject: [PATCH] Fix issues with grid layout --- layouts/grid.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 }