summaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2018-01-12 16:57:11 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-01-12 10:26:05 -0800
commitb4d37e8eeb061b19b8d506cd74f860bf1de2c01d (patch)
treec7c635efd831780cfa638dd647c8654c6765c6fe /profile-widget
parent082def8162baaf866286dace5bc28caf189a828f (diff)
downloadsubsurface-b4d37e8eeb061b19b8d506cd74f860bf1de2c01d.tar.gz
profile: fix garbled profiles after visiting the planner
See mentioned GitHub issue for the full issue, and images. The reason for this weird behavior is the existence of 2 flags in the profile code: shouldCalculateMaxTime and shouldCalculateMaxDepth. When exactly following the use case and test data as attached to the GitHub issue (a very short dive, shorter than most of the dives in the logbook), the shouldCalculateMaxTime flag never got back to its true status, causing the the time scale not to adapt to other dives when just clicking (or selecting) them from the dive list. The problem is fixed here by also setting the shouldCalculateMaxTime flag on manipulating wayppoints in the dive plan. Fixes: #1039 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/profilewidget2.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 976f29d07..1f382ebb4 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -878,21 +878,21 @@ void ProfileWidget2::mousePressEvent(QMouseEvent *event)
return;
QGraphicsView::mousePressEvent(event);
if (currentState == PLAN || currentState == ADD || currentState == EDIT)
- shouldCalculateMaxTime = false;
+ shouldCalculateMaxDepth = shouldCalculateMaxTime = false;
}
void ProfileWidget2::divePlannerHandlerClicked()
{
if (zoomLevel)
return;
- shouldCalculateMaxDepth = false;
+ shouldCalculateMaxDepth = shouldCalculateMaxTime = false;
}
void ProfileWidget2::divePlannerHandlerReleased()
{
if (zoomLevel)
return;
- shouldCalculateMaxDepth = true;
+ shouldCalculateMaxDepth = shouldCalculateMaxTime = true;
replot();
}