]> Shamusworld >> Repos - architektonas/blobdiff - src/drawingview.cpp
Beginnings of visual feedback for editing shapes.
[architektonas] / src / drawingview.cpp
index 55b56e7d87e02ae0aa5cbd1b1e4c428ffca9ebb2..920760ef6b592485cea97976c62feadb610d8a39 100644 (file)
@@ -20,7 +20,7 @@
 
 // Uncomment this for debugging...
 //#define DEBUG
-//#define DEBUGFOO            // Various tool debugging...
+//#define DEBUGFOO                             // Various tool debugging...
 //#define DEBUGTP                              // Toolpalette debugging...
 
 #include "drawingview.h"
@@ -158,12 +158,15 @@ void DrawingView::mouseMoveEvent(QMouseEvent * event)
        // snap to the one before it. So we add half of the grid spacing to the
        // point, then divide by it so that we can remove the fractional part, then
        // multiply it back to get back to the correct answer.
-       point += gridSpacing / 2.0;                                     // *This* adds to Z!!!
-       point /= gridSpacing;
-       point.x = floor(point.x);//need to fix this for negative numbers...
-       point.y = floor(point.y);
-       point.z = 0;                                                            // Make *sure* Z doesn't go anywhere!!!
-       point *= gridSpacing;
+       if (event->buttons() & Qt::LeftButton)
+       {
+               point += gridSpacing / 2.0;                                     // *This* adds to Z!!!
+               point /= gridSpacing;
+               point.x = floor(point.x);//need to fix this for negative numbers...
+               point.y = floor(point.y);
+               point.z = 0;                                                            // Make *sure* Z doesn't go anywhere!!!
+               point *= gridSpacing;
+       }
 #endif
 //we should keep track of the last point here and only pass this down *if* the point
 //changed...