From 1e81dff946b8dd4e0c9526329cf095b55a9c7ccc Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Wed, 11 Mar 2015 03:23:45 +0200 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'qt-ui/profile/profilewidget2.cpp') 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; -- cgit v1.2.3-70-g09d2