Always keep last point of drawn polyline
authorunc0rr
Mon, 06 Dec 2010 12:21:12 +0300
changeset 4471 220d44cb8659
parent 4469 b08c7ebcadb2
child 4472 9cf7ec8fdb71
Always keep last point of drawn polyline
tools/drawMapTest/drawmapscene.cpp
--- a/tools/drawMapTest/drawmapscene.cpp	Mon Dec 06 00:33:39 2010 -0500
+++ b/tools/drawMapTest/drawmapscene.cpp	Mon Dec 06 12:21:12 2010 +0300
@@ -147,7 +147,9 @@
     int i = 1;
     while(i < points.size())
     {
-        if(sqr(prevPoint.x() - points[i].x()) + sqr(prevPoint.y() - points[i].y()) < 1000)
+        if( (i != points.size() - 1)
+            && (sqr(prevPoint.x() - points[i].x()) + sqr(prevPoint.y() - points[i].y()) < 1000)
+          )
             points.removeAt(i);
         else
         {