From bb84b75db997d1c164ac747183e6baf7a52d0c75 Mon Sep 17 00:00:00 2001 From: RickyRister <42636155+RickyRister@users.noreply.github.com> Date: Sat, 30 Nov 2024 05:53:10 -0800 Subject: [PATCH] fix bug where card view window with pile view is too short (#5212) --- cockatrice/src/game/zones/view_zone.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/game/zones/view_zone.cpp b/cockatrice/src/game/zones/view_zone.cpp index 566b4896e..f04bda042 100644 --- a/cockatrice/src/game/zones/view_zone.cpp +++ b/cockatrice/src/game/zones/view_zone.cpp @@ -193,7 +193,9 @@ ZoneViewZone::GridSize ZoneViewZone::positionCardsForDisplay(CardList &cards, Ca longestRow = qMax(row, longestRow); } - return GridSize{longestRow, qMax(col + 1, 3)}; + // +1 because the row/col variables used in the calculations are 0-indexed but + // GridSize expects the actual row/col count + return GridSize{longestRow + 1, qMax(col + 1, 3)}; } else { int cols = qMin(qFloor(qSqrt((double)cardCount / 2)), 7);