changed card hover handling

This commit is contained in:
Max-Wilhelm Bruker 2010-11-09 16:19:13 +01:00
parent 5b7dd037c1
commit 92d40515f2
12 changed files with 66 additions and 18 deletions

View file

@ -153,12 +153,14 @@ void ArrowDragItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
QPointF endPos = event->scenePos();
QList<QGraphicsItem *> colliding = scene()->items(endPos);
ArrowTarget *cursorItem = 0;
for (int i = colliding.size() - 1; i >= 0; i--)
if (qgraphicsitem_cast<PlayerTarget *>(colliding.at(i)) || qgraphicsitem_cast<CardItem *>(colliding.at(i))) {
cursorItem = static_cast<ArrowTarget *>(colliding.at(i));
break;
}
ArrowTarget *cursorItem = 0;
int 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) {
cursorItem = static_cast<ArrowTarget *>(colliding.at(i));
cursorItemZ = cursorItem->zValue();
}
if ((cursorItem != targetItem) && targetItem) {
targetItem->setBeingPointedAt(false);
targetItem->removeArrowTo(this);