diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2009-05-22 15:08:21 -0400 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2009-05-22 15:08:21 -0400 |
commit | ccdf1bf8115908f64904fb8b5afd5a2816b7aa7c (patch) | |
tree | 7a41f3bb1351760e3eafd6414c90ebc85775b7ce | |
parent | e53598ecd8bfe5f2e05dbedc369ff2f972d2d1d3 (diff) | |
download | sigen-ccdf1bf8115908f64904fb8b5afd5a2816b7aa7c.tar.gz sigen-ccdf1bf8115908f64904fb8b5afd5a2816b7aa7c.tar.xz sigen-ccdf1bf8115908f64904fb8b5afd5a2816b7aa7c.zip |
handle the fact that the right and bottom edges of polygons are not "inside" the polygon
-rw-r--r-- | sigmodr/widgets/mapeditor/WorldMapPlacement.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sigmodr/widgets/mapeditor/WorldMapPlacement.cpp b/sigmodr/widgets/mapeditor/WorldMapPlacement.cpp index 8ef35d9c..33dfeac6 100644 --- a/sigmodr/widgets/mapeditor/WorldMapPlacement.cpp +++ b/sigmodr/widgets/mapeditor/WorldMapPlacement.cpp @@ -68,11 +68,15 @@ static bool touches(const QPolygon& polygon1, const QPolygon& polygon2) { if (polygon2.containsPoint(point, Qt::OddEvenFill)) return true; + if (polygon2.containsPoint(point - QPoint(1, 1), Qt::OddEvenFill)) + return true; } foreach (const QPoint& point, polygon2) { if (polygon1.containsPoint(point, Qt::OddEvenFill)) return true; + if (polygon1.containsPoint(point - QPoint(1, 1), Qt::OddEvenFill)) + return true; } return false; } |