mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
fix bug where card view window with single card is too short (#5211)
It was a divide by 0 bug lol
This commit is contained in:
parent
bb84b75db9
commit
70559d32df
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue