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>
This commit is contained in:
Tomaz Canabrava 2013-12-11 22:29:28 -02:00 committed by Dirk Hohndel
parent 0b0860d24a
commit 9a497b1cb0

View file

@ -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();
}