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>
This commit is contained in:
Lubomir I. Ivanov 2015-03-11 03:23:45 +02:00 committed by Dirk Hohndel
parent 2a1a868db2
commit 1e81dff946

View file

@ -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;