From f7a734234414200838aaa339ae2054cb4870c5fb Mon Sep 17 00:00:00 2001 From: RickyRister Date: Thu, 28 Nov 2024 04:04:15 -0800 Subject: [PATCH] rename some variables --- cockatrice/src/game/zones/view_zone.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cockatrice/src/game/zones/view_zone.cpp b/cockatrice/src/game/zones/view_zone.cpp index 1e11ba13a..4dc74f95b 100644 --- a/cockatrice/src/game/zones/view_zone.cpp +++ b/cockatrice/src/game/zones/view_zone.cpp @@ -133,8 +133,8 @@ ZoneViewZone::GridSize ZoneViewZone::positionCardsForDisplay(CardList &cards, bo { int cardCount = cards.size(); if (groupByType) { - int typeRow = 0; - int typeColumn = 0; + int row = 0; + int col = 0; int longestRow = 0; QString lastCardType; for (int i = 0; i < cardCount; i++) { @@ -143,22 +143,22 @@ ZoneViewZone::GridSize ZoneViewZone::positionCardsForDisplay(CardList &cards, bo if (i) { // if not the first card if (cardType == lastCardType) - typeRow++; // add below current card - else { // if no match then move card to next column - typeColumn++; - typeRow = 0; + row++; // add below current card + else { // if no match then move card to next column + col++; + row = 0; } } lastCardType = cardType; - qreal x = typeColumn * CARD_WIDTH; - qreal y = typeRow * CARD_HEIGHT / 3; + qreal x = col * CARD_WIDTH; + qreal y = row * CARD_HEIGHT / 3; c->setPos(HORIZONTAL_PADDING + x, VERTICAL_PADDING + y); c->setRealZValue(i); - longestRow = qMax(typeRow, longestRow); + longestRow = qMax(row, longestRow); } - return GridSize{longestRow, qMax(typeColumn + 1, 3)}; + return GridSize{longestRow, qMax(col + 1, 3)}; } else { int cols = qFloor(qSqrt((double)cardCount / 2));