mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-20 17:32:15 -07:00
use max/min
This commit is contained in:
parent
f7a7342344
commit
923240e956
1 changed files with 2 additions and 6 deletions
|
|
@ -161,12 +161,8 @@ ZoneViewZone::GridSize ZoneViewZone::positionCardsForDisplay(CardList &cards, bo
|
|||
return GridSize{longestRow, qMax(col + 1, 3)};
|
||||
|
||||
} else {
|
||||
int cols = qFloor(qSqrt((double)cardCount / 2));
|
||||
if (cols > 7)
|
||||
cols = 7;
|
||||
int rows = qCeil((double)cardCount / cols);
|
||||
if (rows < 1)
|
||||
rows = 1;
|
||||
int cols = qMin(qFloor(qSqrt((double)cardCount / 2)), 7);
|
||||
int rows = qMax(qCeil((double)cardCount / cols), 1);
|
||||
if (minRows == 0)
|
||||
minRows = rows;
|
||||
else if (rows < minRows) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue