mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-16 07:22:16 -07:00
Also update the currentZone
This commit is contained in:
parent
a8074ba1f2
commit
488e0a3f54
1 changed files with 6 additions and 2 deletions
|
|
@ -47,8 +47,13 @@ void CardDragItem::updatePosition(const QPointF &cursorScenePos)
|
||||||
cursorZone = zoneViewZone;
|
cursorZone = zoneViewZone;
|
||||||
else if (cardZone)
|
else if (cardZone)
|
||||||
cursorZone = cardZone;
|
cursorZone = cardZone;
|
||||||
|
|
||||||
|
// Always update the current zone, even if its null, to cancel the drag
|
||||||
|
// instead of dropping cards into an non-intuitive location.
|
||||||
|
currentZone = cursorZone;
|
||||||
|
|
||||||
if (!cursorZone) {
|
if (!cursorZone) {
|
||||||
// Temporary fix: avoid the cards getting stuck visually when not over
|
// Avoid the cards getting stuck visually when not over
|
||||||
// any zone.
|
// any zone.
|
||||||
QPointF newPos = cursorScenePos - hotSpot;
|
QPointF newPos = cursorScenePos - hotSpot;
|
||||||
|
|
||||||
|
|
@ -60,7 +65,6 @@ void CardDragItem::updatePosition(const QPointF &cursorScenePos)
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
currentZone = cursorZone;
|
|
||||||
|
|
||||||
QPointF zonePos = currentZone->scenePos();
|
QPointF zonePos = currentZone->scenePos();
|
||||||
QPointF cursorPosInZone = cursorScenePos - zonePos;
|
QPointF cursorPosInZone = cursorScenePos - zonePos;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue