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

This commit is contained in:
RickyRister 2024-11-30 01:10:55 -08:00
parent e33ff37c82
commit 86e4609b75

View file

@ -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);