mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 17:02:15 -07:00
refactor: clean up to use for-each loop
This commit is contained in:
parent
de63066b0b
commit
92cefe2a27
1 changed files with 5 additions and 5 deletions
|
|
@ -58,11 +58,11 @@ void SelectZone::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||||
pos.setY(br.height());
|
pos.setY(br.height());
|
||||||
|
|
||||||
QRectF selectionRect = QRectF(selectionOrigin, pos).normalized();
|
QRectF selectionRect = QRectF(selectionOrigin, pos).normalized();
|
||||||
for (int i = 0; i < cards.size(); ++i) {
|
for (auto card : cards) {
|
||||||
if (cards[i]->getAttachedTo())
|
if (card->getAttachedTo() && card->getAttachedTo()->getZone() != this) {
|
||||||
if (cards[i]->getAttachedTo()->getZone() != this)
|
continue;
|
||||||
continue;
|
}
|
||||||
cards[i]->setSelected(selectionRect.intersects(cards[i]->mapRectToParent(cards[i]->boundingRect())));
|
card->setSelected(selectionRect.intersects(card->mapRectToParent(card->boundingRect())));
|
||||||
}
|
}
|
||||||
static_cast<GameScene *>(scene())->resizeRubberBand(
|
static_cast<GameScene *>(scene())->resizeRubberBand(
|
||||||
deviceTransform(static_cast<GameScene *>(scene())->getViewportTransform()).map(pos));
|
deviceTransform(static_cast<GameScene *>(scene())->getViewportTransform()).map(pos));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue