diff --git a/src/zoomer.cpp b/src/zoomer.cpp --- a/src/zoomer.cpp +++ b/src/zoomer.cpp @@ -29,11 +29,6 @@ Zoomer::Zoomer(QWidget* widget, bool doR void Zoomer::zoom(int up) { - if (up == +1) - { - this->setZoomBase(this->plot()); - } - ScrollZoomer::zoom(up); if(zoomRectIndex() == 0) @@ -41,3 +36,14 @@ void Zoomer::zoom(int up) emit unzoomed(); } } + +void Zoomer::zoom( const QRectF & rect) +{ + // set the zoom base when user zooms in to first level + if (zoomRectIndex() == 0) + { + this->setZoomBase(false); + } + + ScrollZoomer::zoom(rect); +}