summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-12-11 22:29:28 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-12 03:26:39 +0100
commit9a497b1cb0f38e8a7e04e29543da5241a38d2195 (patch)
tree099fb539aa7811aea1644ca4193ae1809a2fe9f2
parent0b0860d24a81b0bce9ea4f972cb088d5a217c4f5 (diff)
downloadsubsurface-9a497b1cb0f38e8a7e04e29543da5241a38d2195.tar.gz
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 <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/diveplanner.cpp8
1 files changed, 4 insertions, 4 deletions
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();
}