diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2015-03-11 03:23:45 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-03-11 07:38:46 -0700 |
commit | 1e81dff946b8dd4e0c9526329cf095b55a9c7ccc (patch) | |
tree | 9eda3efa740b51461f655fddca5751fe7f417f39 /qt-ui | |
parent | 2a1a868db20f2fea08f946cf3733d6deeb61b066 (diff) | |
download | subsurface-1e81dff946b8dd4e0c9526329cf095b55a9c7ccc.tar.gz |
Planner: disable mouse interaction when zoomed in
When zoomed in, things like moving planner points is not possible,
but if the user attempts that, replan() -> plotDive() is called
and the zoomLevel should be reset to the default value (we don't
really want that), but instead it's lost for some reason
(as the user reports: "Somes times, it changes to 100% which is ok").
If moving points becomes possible eventually while zoomed in,
we need to figure a way to replot without resetting the zoom level
in plotDive().
Fixes #851
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index cfcd25dab..d385e0c30 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -733,6 +733,8 @@ void ProfileWidget2::resizeEvent(QResizeEvent *event) void ProfileWidget2::mousePressEvent(QMouseEvent *event) { + if (zoomLevel) + return; QGraphicsView::mousePressEvent(event); if (currentState == PLAN) shouldCalculateMaxTime = false; @@ -740,18 +742,24 @@ void ProfileWidget2::mousePressEvent(QMouseEvent *event) void ProfileWidget2::divePlannerHandlerClicked() { + if (zoomLevel) + return; shouldCalculateMaxDepth = false; replot(); } void ProfileWidget2::divePlannerHandlerReleased() { + if (zoomLevel) + return; shouldCalculateMaxDepth = true; replot(); } void ProfileWidget2::mouseReleaseEvent(QMouseEvent *event) { + if (zoomLevel) + return; QGraphicsView::mouseReleaseEvent(event); if (currentState == PLAN) { shouldCalculateMaxTime = true; |