Fix indentation (and Debug build) (#2418)
* Fix indentation (and Debug build) * More indentation fixes
This commit is contained in:
parent
24c95e00ed
commit
9ba3f21730
2 changed files with 59 additions and 50 deletions
|
@ -130,11 +130,12 @@ void ArrowItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QGraphicsItem *> colliding = scene()->items(event->scenePos());
|
QList<QGraphicsItem *> colliding = scene()->items(event->scenePos());
|
||||||
for (int i = 0; i < colliding.size(); ++i)
|
for (int i = 0; i < colliding.size(); ++i) {
|
||||||
if (qgraphicsitem_cast<CardItem *>(colliding[i])) {
|
if (qgraphicsitem_cast<CardItem *>(colliding[i])) {
|
||||||
event->ignore();
|
event->ignore();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
event->accept();
|
event->accept();
|
||||||
if (event->button() == Qt::RightButton) {
|
if (event->button() == Qt::RightButton) {
|
||||||
|
@ -166,12 +167,15 @@ void ArrowDragItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||||
QList<QGraphicsItem *> colliding = scene()->items(endPos);
|
QList<QGraphicsItem *> colliding = scene()->items(endPos);
|
||||||
ArrowTarget *cursorItem = 0;
|
ArrowTarget *cursorItem = 0;
|
||||||
qreal cursorItemZ = -1;
|
qreal cursorItemZ = -1;
|
||||||
for (int i = colliding.size() - 1; i >= 0; i--)
|
for (int i = colliding.size() - 1; i >= 0; i--) {
|
||||||
if (qgraphicsitem_cast<PlayerTarget *>(colliding.at(i)) || qgraphicsitem_cast<CardItem *>(colliding.at(i)))
|
if (qgraphicsitem_cast<PlayerTarget *>(colliding.at(i)) || qgraphicsitem_cast<CardItem *>(colliding.at(i))) {
|
||||||
if (colliding.at(i)->zValue() > cursorItemZ) {
|
if (colliding.at(i)->zValue() > cursorItemZ) {
|
||||||
cursorItem = static_cast<ArrowTarget *>(colliding.at(i));
|
cursorItem = static_cast<ArrowTarget *>(colliding.at(i));
|
||||||
cursorItemZ = cursorItem->zValue();
|
cursorItemZ = cursorItem->zValue();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((cursorItem != targetItem) && targetItem) {
|
if ((cursorItem != targetItem) && targetItem) {
|
||||||
targetItem->setBeingPointedAt(false);
|
targetItem->setBeingPointedAt(false);
|
||||||
targetItem->removeArrowTo(this);
|
targetItem->removeArrowTo(this);
|
||||||
|
@ -193,9 +197,10 @@ void ArrowDragItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
|
|
||||||
for (int i = 0; i < childArrows.size(); ++i)
|
for (int i = 0; i < childArrows.size(); ++i) {
|
||||||
childArrows[i]->mouseMoveEvent(event);
|
childArrows[i]->mouseMoveEvent(event);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ArrowDragItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
void ArrowDragItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
|
@ -257,23 +262,27 @@ void ArrowAttachItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||||
QList<QGraphicsItem *> colliding = scene()->items(endPos);
|
QList<QGraphicsItem *> colliding = scene()->items(endPos);
|
||||||
ArrowTarget *cursorItem = 0;
|
ArrowTarget *cursorItem = 0;
|
||||||
qreal cursorItemZ = -1;
|
qreal cursorItemZ = -1;
|
||||||
for (int i = colliding.size() - 1; i >= 0; i--)
|
for (int i = colliding.size() - 1; i >= 0; i--) {
|
||||||
if (qgraphicsitem_cast<CardItem *>(colliding.at(i)))
|
if (qgraphicsitem_cast<CardItem *>(colliding.at(i))) {
|
||||||
if (colliding.at(i)->zValue() > cursorItemZ) {
|
if (colliding.at(i)->zValue() > cursorItemZ) {
|
||||||
cursorItem = static_cast<ArrowTarget *>(colliding.at(i));
|
cursorItem = static_cast<ArrowTarget *>(colliding.at(i));
|
||||||
cursorItemZ = cursorItem->zValue();
|
cursorItemZ = cursorItem->zValue();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((cursorItem != targetItem) && targetItem)
|
if ((cursorItem != targetItem) && targetItem) {
|
||||||
targetItem->setBeingPointedAt(false);
|
targetItem->setBeingPointedAt(false);
|
||||||
|
}
|
||||||
if (!cursorItem) {
|
if (!cursorItem) {
|
||||||
fullColor = false;
|
fullColor = false;
|
||||||
targetItem = 0;
|
targetItem = 0;
|
||||||
updatePath(endPos);
|
updatePath(endPos);
|
||||||
} else {
|
} else {
|
||||||
fullColor = true;
|
fullColor = true;
|
||||||
if (cursorItem != startItem)
|
if (cursorItem != startItem) {
|
||||||
cursorItem->setBeingPointedAt(true);
|
cursorItem->setBeingPointedAt(true);
|
||||||
|
}
|
||||||
targetItem = cursorItem;
|
targetItem = cursorItem;
|
||||||
updatePath();
|
updatePath();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue