]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/actionzoompan.cpp
Bugfixes related to removing Snapper class.
[architektonas] / src / actions / actionzoompan.cpp
index 0425f60e014d1fd0502b8b92de783c66c80d96b7..c2f028008844fc5af86303ff74a89368c7fc9d69 100644 (file)
@@ -3,7 +3,9 @@
 // Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
 // Extensively rewritten and refactored by James L. Hammons
-// (C) 2010 Underground Software
+// Portions copyright (C) 2001-2003 RibbonSoft
+// Copyright (C) 2010 Underground Software
+// See the README and GPLv2 files for licensing and warranty information
 //
 // JLH = James L. Hammons <jlhamm@acm.org>
 //
 
 #include "graphicview.h"
 
-ActionZoomPan::ActionZoomPan(RS_EntityContainer & container, GraphicView & graphicView):
+ActionZoomPan::ActionZoomPan(EntityContainer & container, GraphicView & graphicView):
        ActionInterface("Zoom Pan", container, graphicView)
 {
+//     graphicView.snapper.SetVisible(false);
+       graphicView.SetSnapperVisible(false);
+       graphicView.preview.SetVisible(false);
 }
 
 ActionZoomPan::~ActionZoomPan()
@@ -59,7 +64,7 @@ void ActionZoomPan::mouseMoveEvent(QMouseEvent * e)
 
 void ActionZoomPan::mousePressEvent(QMouseEvent * e)
 {
-       if (e->button() == Qt::MidButton || e->button() == Qt::LeftButton)
+       if (e->button() == Qt::LeftButton || e->button() == Qt::MidButton)
        {
                x1 = e->x();
                y1 = e->y();
@@ -69,12 +74,16 @@ void ActionZoomPan::mousePressEvent(QMouseEvent * e)
 
 void ActionZoomPan::mouseReleaseEvent(QMouseEvent * e)
 {
-       if (e->button() == Qt::RightButton)
+       // Right button? Why?
+       // Is this a regular tool? Is this why? (yup, it is. but lame nonetheless.)
+       // It doesn't revert the cursor correctly if this is not in...
+       // So... We need to fix this... [DONE]
+       /*if (e->button() == Qt::RightButton)
                init(getStatus() - 1);
-       else if (e->button() == Qt::MidButton)
+       else*/ if (e->button() == Qt::MidButton || e->button() == Qt::RightButton)
                init(-1);
        else
-               setStatus(0);
+               setStatus(0);   // Qt::LeftButton
 }
 
 void ActionZoomPan::updateMouseCursor()