some fixes

This commit is contained in:
Max-Wilhelm Bruker 2009-09-08 22:45:48 +02:00
parent ca07cce5ed
commit 00a2f49c94
9 changed files with 128 additions and 67 deletions

View file

@ -53,8 +53,7 @@ void CardDragItem::updatePosition(const QPointF &cursorScenePos)
QPointF zonePos = currentZone->scenePos();
QPointF cursorPosInZone = cursorScenePos - zonePos;
QPointF cardTopLeft = cursorPosInZone - hotSpot;
// QPointF cardCenter = cardTopLeft + QPointF(CARD_WIDTH / 2, CARD_HEIGHT / 2);
QPointF newPos = zonePos + cursorZone->closestGridPoint(cardTopLeft + QPoint(CARD_WIDTH / 2, CARD_HEIGHT / 2));
QPointF newPos = zonePos + cursorZone->closestGridPoint(cardTopLeft);
// qDebug(QString("cardTopLeft = %1, %2 cardCenter = %3, %4").arg((cardTopLeft).x()).arg((cardTopLeft).y()).arg(cardCenter.x()).arg(cardCenter.y()).toLatin1());