X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Frs_actionzoompan.cpp;h=2066442bd361d8277e9340785a1a4ed92f99e876;hb=be33e866f2121c48db93e06d743c5ae3826c1948;hp=7e788de415e4aa6a140a88906e1aaf9e064e455e;hpb=46a5b82a20219b6d24e6095f56843db3eaa45595;p=architektonas diff --git a/src/actions/rs_actionzoompan.cpp b/src/actions/rs_actionzoompan.cpp index 7e788de..2066442 100644 --- a/src/actions/rs_actionzoompan.cpp +++ b/src/actions/rs_actionzoompan.cpp @@ -14,9 +14,9 @@ #include "rs_actionzoompan.h" -#include "rs_graphicview.h" +#include "graphicview.h" -RS_ActionZoomPan::RS_ActionZoomPan(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionZoomPan::RS_ActionZoomPan(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Zoom Pan", container, graphicView) { } @@ -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