]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/rs_actionzoompan.cpp
Scrubbed all references to CreatePainter(), CreateDirectPainter() and
[architektonas] / src / actions / rs_actionzoompan.cpp
index 7e788de415e4aa6a140a88906e1aaf9e064e455e..ac46efb81e7e3eae49276d605bc607cd8f830cac 100644 (file)
@@ -30,17 +30,11 @@ void RS_ActionZoomPan::init(int status)
        RS_ActionInterface::init(status);
        snapMode = RS2::SnapFree;
        snapRes = RS2::RestrictNothing;
-       //v1 = v2 = Vector(false);
        x1 = y1 = x2 = y2 = -1;
-       //graphicView->saveView();
 }
 
 void RS_ActionZoomPan::trigger()
 {
-       /*if (v1.valid && v2.valid) {
-           graphicView->zoomPan(v2-v1);
-           v1 = v2;
-          }*/
        if (x1 >= 0)
        {
                graphicView->zoomPan(x2 - x1, y2 - y1);
@@ -51,21 +45,18 @@ void RS_ActionZoomPan::trigger()
 
 void RS_ActionZoomPan::mouseMoveEvent(QMouseEvent * e)
 {
-       //v2 = snapPoint(e);
        x2 = e->x();
        y2 = e->y();
 
-       //if (getStatus()==1 && graphicView->toGuiDX((v2-v1).magnitude())>10) {
+//This is where we see if the delta was big enough to warrant a redraw...
        if (getStatus() == 1 && (abs(x2 - x1) > 7 || abs(y2 - y1) > 7))
                trigger();
 }
 
 void RS_ActionZoomPan::mousePressEvent(QMouseEvent * e)
 {
-       if (e->button() == Qt::MidButton
-           || e->button() == Qt::LeftButton)
+       if (e->button() == Qt::MidButton || e->button() == Qt::LeftButton)
        {
-               //v1 = snapPoint(e);
                x1 = e->x();
                y1 = e->y();
                setStatus(1);
@@ -90,5 +81,3 @@ void RS_ActionZoomPan::updateMouseCursor()
        graphicView->setMouseCursor(RS2::SizeAllCursor);
 #endif
 }
-
-// EOF