QTfrontend/drawmapscene.cpp
changeset 13236 ef1393c6bd12
parent 13209 f5d36be88c61
child 13931 6c8d4e140f27
--- a/QTfrontend/drawmapscene.cpp	Sat Mar 17 04:37:13 2018 +0100
+++ b/QTfrontend/drawmapscene.cpp	Sat Mar 17 15:51:45 2018 +0100
@@ -336,8 +336,12 @@
 {
     hideCursor();
 
+    // Remember erasing mode
     bool erasing = m_isErasing;
 
+    // Use seperate for decoding the map, don't mess with the user pen
+    QPen load_pen = QPen(m_pen);
+
     oldItems.clear();
     oldPaths.clear();
     clear();
@@ -363,7 +367,7 @@
 
             if(params.points.size())
             {
-                addPath(pointsToPath(params.points), m_pen);
+                addPath(pointsToPath(params.points), load_pen);
 
                 paths.prepend(params);
 
@@ -371,12 +375,12 @@
             }
 
             quint8 penWidth = flags & 0x3f;
-            m_pen.setWidth(deserializePenWidth(penWidth));
+            load_pen.setWidth(deserializePenWidth(penWidth));
             params.erasing = flags & 0x40;
             if(params.erasing)
-                m_pen.setBrush(m_eraser);
+                load_pen.setBrush(m_eraser);
             else
-                m_pen.setBrush(m_brush);
+                load_pen.setBrush(m_brush);
             params.width = penWidth;
         } else
             if(isSpecial)
@@ -399,12 +403,13 @@
 
     if(params.points.size())
     {
-        addPath(pointsToPath(params.points), m_pen);
+        addPath(pointsToPath(params.points), load_pen);
         paths.prepend(params);
     }
 
     emit pathChanged();
 
+    // Restore erasing mode
     setErasing(erasing);
 }