mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
fixed compiler warnings
This commit is contained in:
parent
33e47c2653
commit
117a77655b
2 changed files with 7 additions and 7 deletions
|
|
@ -13,7 +13,7 @@ TableZone::TableZone(Player *_p, QGraphicsItem *parent)
|
|||
|
||||
economicGrid = settings.value("table/economic", 1).toInt();
|
||||
if (economicGrid)
|
||||
height = 14.0 / 3 * CARD_HEIGHT + 3 * paddingY;
|
||||
height = (int) (14.0 / 3 * CARD_HEIGHT + 3 * paddingY);
|
||||
else
|
||||
height = 4 * CARD_HEIGHT + 3 * paddingY;
|
||||
width = minWidth + 2 * marginX;
|
||||
|
|
@ -103,7 +103,7 @@ void TableZone::resizeToContents()
|
|||
int xMax = 0;
|
||||
for (int i = 0; i < cards.size(); ++i)
|
||||
if (cards[i]->pos().x() > xMax)
|
||||
xMax = cards[i]->pos().x();
|
||||
xMax = (int) cards[i]->pos().x();
|
||||
xMax += 2 * CARD_WIDTH;
|
||||
if (xMax < minWidth)
|
||||
xMax = minWidth;
|
||||
|
|
@ -156,19 +156,19 @@ QPoint TableZone::mapToGrid(const QPointF &mapPoint) const
|
|||
y = height - CARD_HEIGHT;
|
||||
|
||||
QPoint result = QPoint(
|
||||
x * 2 / CARD_WIDTH,
|
||||
y / (CARD_HEIGHT + paddingY)
|
||||
(int) (x * 2 / CARD_WIDTH),
|
||||
(int) (y / (CARD_HEIGHT + paddingY))
|
||||
);
|
||||
|
||||
if (result.y() == 3) {
|
||||
if (economicGrid)
|
||||
return QPoint(
|
||||
x * 2 / CARD_WIDTH - floor(x / (2 * CARD_WIDTH)),
|
||||
(int) (x * 2 / CARD_WIDTH - floor(x / (2 * CARD_WIDTH))),
|
||||
3
|
||||
);
|
||||
else
|
||||
return QPoint(
|
||||
x / (1.5 * CARD_WIDTH),
|
||||
(int) (x / (1.5 * CARD_WIDTH)),
|
||||
3
|
||||
);
|
||||
} else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue