QTfrontend/drawmapscene.cpp
changeset 4937 55b9145fea94
parent 4666 34551d8639cf
child 4938 0985edac2ad7
--- a/QTfrontend/drawmapscene.cpp	Tue Feb 08 22:24:30 2011 +0300
+++ b/QTfrontend/drawmapscene.cpp	Wed Feb 09 21:59:43 2011 +0300
@@ -1,6 +1,7 @@
 #include <QGraphicsSceneMouseEvent>
 #include <QGraphicsPathItem>
 #include <QtEndian>
+#include <QDebug>
 
 #include "drawmapscene.h"
 
@@ -32,8 +33,18 @@
     if(m_currPath && (mouseEvent->buttons() & Qt::LeftButton))
     {
         QPainterPath path = m_currPath->path();
-        path.lineTo(mouseEvent->scenePos());
-        paths.first().append(mouseEvent->scenePos().toPoint());
+
+        if(mouseEvent->modifiers() & Qt::AltModifier)
+        {
+            int c = path.elementCount();
+            QPointF pos = mouseEvent->scenePos();
+            path.setElementPositionAt(c - 1, pos.x(), pos.y());
+
+        } else
+        {
+            path.lineTo(mouseEvent->scenePos());
+            paths.first().append(mouseEvent->scenePos().toPoint());
+        }
         m_currPath->setPath(path);
 
         emit pathChanged();