diff --git a/cockatrice/src/player.cpp b/cockatrice/src/player.cpp index 24e3b232..319a016d 100644 --- a/cockatrice/src/player.cpp +++ b/cockatrice/src/player.cpp @@ -39,7 +39,7 @@ Player::Player(const QString &_name, int _id, bool _local, CardDatabase *_db, Cl table = new TableZone(this, this); connect(table, SIGNAL(sizeChanged()), this, SLOT(updateBoundingRect())); - hand = new HandZone(this, table->boundingRect().height(), this); + hand = new HandZone(this, (int) table->boundingRect().height(), this); base = QPointF(deck->boundingRect().width() + 60, 0); hand->setPos(base); diff --git a/cockatrice/src/tablezone.cpp b/cockatrice/src/tablezone.cpp index aadeeb5a..535d541d 100644 --- a/cockatrice/src/tablezone.cpp +++ b/cockatrice/src/tablezone.cpp @@ -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