From 9a497b1cb0f38e8a7e04e29543da5241a38d2195 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 11 Dec 2013 22:29:28 -0200 Subject: Keep track of the minimum Depth / time on the planner. This patch makes sure that the minimum time / depth is correctly set on the profile planner. Fixes: #358 Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'qt-ui/diveplanner.cpp') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index fe7a7d1e3..6fb9ecef3 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -500,13 +500,13 @@ void DivePlannerGraphics::drawProfile() } if (!activeDraggedHandler && (timeLine->maximum() < dp->time / 60.0 + 5 || dp->time / 60.0 + 15 < timeLine->maximum())) { - double newMax = fmax(dp->time / 60.0 + 5, minMinutes); - timeLine->setMaximum(newMax); + minMinutes = fmax(dp->time / 60.0 + 5, minMinutes); + timeLine->setMaximum(minMinutes); timeLine->updateTicks(); } if (!activeDraggedHandler && (depthLine->maximum() < max_depth + M_OR_FT(10,30) || max_depth + M_OR_FT(10,30) < depthLine->maximum())) { - double newMax = fmax(max_depth + M_OR_FT(10,30), minDepth); - depthLine->setMaximum(newMax); + minDepth = fmax(max_depth + M_OR_FT(10,30), minDepth); + depthLine->setMaximum(minDepth); depthLine->updateTicks(); } -- cgit v1.2.3-70-g09d2