fix bug where card view window with single card is too short

It was a divide by 0 bug lol
This commit is contained in:
RickyRister 2024-11-30 00:07:53 -08:00
parent e33ff37c82
commit 7a3e1f1494

View file

@ -196,7 +196,7 @@ ZoneViewZone::GridSize ZoneViewZone::positionCardsForDisplay(CardList &cards, Ca
return GridSize{longestRow, 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;