diff options
| -rw-r--r-- | sigmodr/widgets/mapeditor/WorldMapPlacement.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sigmodr/widgets/mapeditor/WorldMapPlacement.cpp b/sigmodr/widgets/mapeditor/WorldMapPlacement.cpp index aa7e177b..b2facc97 100644 --- a/sigmodr/widgets/mapeditor/WorldMapPlacement.cpp +++ b/sigmodr/widgets/mapeditor/WorldMapPlacement.cpp @@ -328,13 +328,13 @@ QPoint WorldMapPlacement::find(const QPoint& point) best = closer(best, rect.toRect(), point); else { - const qreal left = collidingRect.left(); - const qreal right = collidingRect.right(); - rect.moveRight(left); + const qreal top = collidingRect.top(); + const qreal bottom = collidingRect.bottom(); + rect.moveBottom(top); collidingRect = collides(rect, m_polygons).boundingRect(); if (collidingRect.isNull()) best = closer(best, rect.toRect(), point); - rect.moveLeft(right); + rect.moveTop(bottom); collidingRect = collides(rect, m_polygons).boundingRect(); if (collidingRect.isNull()) best = closer(best, rect.toRect(), point); @@ -348,13 +348,13 @@ QPoint WorldMapPlacement::find(const QPoint& point) best = closer(best, rect.toRect(), point); else { - const qreal top = collidingRect.top(); - const qreal bottom = collidingRect.bottom(); - rect.moveBottom(top); + const qreal left = collidingRect.left(); + const qreal right = collidingRect.right(); + rect.moveRight(left); collidingRect = collides(rect, m_polygons).boundingRect(); if (collidingRect.isNull()) best = closer(best, rect.toRect(), point); - rect.moveTop(bottom); + rect.moveLeft(right); collidingRect = collides(rect, m_polygons).boundingRect(); if (collidingRect.isNull()) best = closer(best, rect.toRect(), point); |
