summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-04-28 01:42:16 -0400
committerBen Boeckel <MathStuf@gmail.com>2009-04-28 01:42:16 -0400
commitd68f52169e1386bcd9ad9517f6ec19e6b7dbcd14 (patch)
tree192bd77f4559407c1c6344b91326628f58219665
parent58ed24e1b919c695336744166225e386999957c3 (diff)
downloadsigen-d68f52169e1386bcd9ad9517f6ec19e6b7dbcd14.tar.gz
sigen-d68f52169e1386bcd9ad9517f6ec19e6b7dbcd14.tar.xz
sigen-d68f52169e1386bcd9ad9517f6ec19e6b7dbcd14.zip
Fix which edge is moved when collisions happen
-rw-r--r--sigmodr/widgets/mapeditor/WorldMapPlacement.cpp16
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);