aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-07-04 23:55:25 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-07-04 22:58:56 -0700
commit87dda6661cf3c1c056e28767bb15cd3e3bb3f734 (patch)
tree0f6d72a860973c6e105ed6f87a8667a376c6c17c
parent249a1ac1702746dc009d31aad648af08cc11bb7a (diff)
downloadsubsurface-87dda6661cf3c1c056e28767bb15cd3e3bb3f734.tar.gz
Profile: prevent a zoom glitch at maximum zoom level
The 'else if' condition in ProfileGraphicsView::wheelEvent() is causing a zoom-in / zoom-out loop at zoomLevel = 10. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/profilegraphics.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp
index 543e0dbbc..0fcac8a4a 100644
--- a/qt-ui/profilegraphics.cpp
+++ b/qt-ui/profilegraphics.cpp
@@ -78,10 +78,10 @@ void ProfileGraphicsView::wheelEvent(QWheelEvent* event)
QPoint toolTipPos = mapFromScene(toolTip->pos());
double scaleFactor = 1.15;
- if (event->delta() > 0 && zoomLevel <= 10) {
+ if (event->delta() > 0 && zoomLevel < 10) {
scale(scaleFactor, scaleFactor);
zoomLevel++;
- } else if (zoomLevel > 0) {
+ } else if (event->delta() < 0 && zoomLevel > 0) {
// Zooming out
scale(1.0 / scaleFactor, 1.0 / scaleFactor);
zoomLevel--;