diff --git a/cockatrice/src/libraryzone.cpp b/cockatrice/src/libraryzone.cpp index 03546c2e..2a2f74eb 100644 --- a/cockatrice/src/libraryzone.cpp +++ b/cockatrice/src/libraryzone.cpp @@ -81,8 +81,7 @@ void LibraryZone::mouseMoveEvent(QGraphicsSceneMouseEvent *event) setCursor(Qt::OpenHandCursor); } -void LibraryZone::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) +void LibraryZone::mouseReleaseEvent(QGraphicsSceneMouseEvent */*event*/) { - Q_UNUSED(event); setCursor(Qt::OpenHandCursor); } diff --git a/cockatrice/src/tablezone.cpp b/cockatrice/src/tablezone.cpp index 4875e596..99d549a7 100644 --- a/cockatrice/src/tablezone.cpp +++ b/cockatrice/src/tablezone.cpp @@ -14,10 +14,8 @@ QRectF TableZone::boundingRect() const return QRectF(0, 0, width, height); } -void TableZone::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +void TableZone::paint(QPainter *painter, const QStyleOptionGraphicsItem */*option*/, QWidget */*widget*/) { - Q_UNUSED(option); - Q_UNUSED(widget); painter->fillRect(boundingRect(), QColor(0, 0, 100)); } @@ -38,7 +36,17 @@ void TableZone::addCardImpl(CardItem *card, int x, int y) void TableZone::handleDropEvent(int cardId, CardZone *startZone, const QPoint &dropPoint, bool faceDown) { - player->client->moveCard(cardId, startZone->getName(), getName(), dropPoint.x(), dropPoint.y(), faceDown); + int x = dropPoint.x(); + int y = dropPoint.y(); + if (x < 0) + x = 0; + if (y < 0) + y = 0; + if (x > width - CARD_WIDTH) + x = width - CARD_WIDTH; + if (y > height - CARD_HEIGHT) + y = height - CARD_HEIGHT; + player->client->moveCard(cardId, startZone->getName(), getName(), x, y, faceDown); } void TableZone::reorganizeCards()