quick and dirty fix to reversed paths and dropped last message causing drawmap desync
authornemo
Thu, 23 Dec 2010 19:17:14 -0500
changeset 4657 3cd5bd943b94
parent 4656 59e75518fb82
child 4658 280195b0ffbd
quick and dirty fix to reversed paths and dropped last message causing drawmap desync
QTfrontend/drawmapscene.cpp
--- a/QTfrontend/drawmapscene.cpp	Fri Dec 24 00:24:16 2010 +0100
+++ b/QTfrontend/drawmapscene.cpp	Thu Dec 23 19:17:14 2010 -0500
@@ -124,19 +124,19 @@
         quint8 flags = *(quint8 *)data.data();
         data.remove(0, 1);
 
+	if (data.size() < 5) points.append(QPoint(px, py));
         //last chunk or first point
         if((data.size() < 5) || (flags & 0x80))
         {
             if(points.size())
             {
                 addPath(pointsToPath(points), m_pen);
-                paths.prepend(points);
+                paths.append(points);
 
                 points.clear();
             }
         }
-
-        points.append(QPoint(px, py));
+	if (data.size() > 5) points.append(QPoint(px, py));
     }
 
     emit pathChanged();