From 70559d32df6578ad48d744eb9cd6d2171e5bb02c Mon Sep 17 00:00:00 2001 From: RickyRister <42636155+RickyRister@users.noreply.github.com> Date: Sat, 30 Nov 2024 05:53:30 -0800 Subject: [PATCH] fix bug where card view window with single card is too short (#5211) It was a divide by 0 bug lol --- cockatrice/src/game/zones/view_zone.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cockatrice/src/game/zones/view_zone.cpp b/cockatrice/src/game/zones/view_zone.cpp index f04bda042..0187e8ee5 100644 --- a/cockatrice/src/game/zones/view_zone.cpp +++ b/cockatrice/src/game/zones/view_zone.cpp @@ -198,7 +198,7 @@ ZoneViewZone::GridSize ZoneViewZone::positionCardsForDisplay(CardList &cards, Ca return GridSize{longestRow + 1, qMax(col + 1, 3)}; } else { - int cols = qMin(qFloor(qSqrt((double)cardCount / 2)), 7); + int cols = qBound(1, qFloor(qSqrt((double)cardCount / 2)), 7); int rows = qMax(qCeil((double)cardCount / cols), 1); if (minRows == 0) { minRows = rows;