mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
attach arrow bug fix, improved stacking
This commit is contained in:
parent
f94fac80c1
commit
feb1dac1e1
6 changed files with 58 additions and 21 deletions
|
|
@ -154,7 +154,7 @@ void ArrowDragItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
|||
|
||||
QList<QGraphicsItem *> colliding = scene()->items(endPos);
|
||||
ArrowTarget *cursorItem = 0;
|
||||
int cursorItemZ = -1;
|
||||
qreal cursorItemZ = -1;
|
||||
for (int i = colliding.size() - 1; i >= 0; i--)
|
||||
if (qgraphicsitem_cast<PlayerTarget *>(colliding.at(i)) || qgraphicsitem_cast<CardItem *>(colliding.at(i)))
|
||||
if (colliding.at(i)->zValue() > cursorItemZ) {
|
||||
|
|
@ -243,11 +243,14 @@ void ArrowAttachItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
|||
|
||||
QList<QGraphicsItem *> colliding = scene()->items(endPos);
|
||||
ArrowTarget *cursorItem = 0;
|
||||
qreal cursorItemZ = -1;
|
||||
for (int i = colliding.size() - 1; i >= 0; i--)
|
||||
if (qgraphicsitem_cast<CardItem *>(colliding.at(i))) {
|
||||
cursorItem = static_cast<ArrowTarget *>(colliding.at(i));
|
||||
break;
|
||||
}
|
||||
if (qgraphicsitem_cast<CardItem *>(colliding.at(i)))
|
||||
if (colliding.at(i)->zValue() > cursorItemZ) {
|
||||
cursorItem = static_cast<ArrowTarget *>(colliding.at(i));
|
||||
cursorItemZ = cursorItem->zValue();
|
||||
}
|
||||
|
||||
if ((cursorItem != targetItem) && targetItem)
|
||||
targetItem->setBeingPointedAt(false);
|
||||
if (!cursorItem) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue