aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/profilewidget2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r--qt-ui/profile/profilewidget2.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index e1c154546..49dca4c68 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -252,10 +252,12 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
* shown.
*/
struct plot_info pInfo = calculate_max_limits_new(d, currentdc);
+ int maxtime = get_maxtime(&pInfo);
+ int maxdepth = get_maxdepth(&pInfo);
- profileYAxis->setMaximum(pInfo.maxdepth);
+ profileYAxis->setMaximum(qMax<long>(pInfo.maxdepth + M_OR_FT(10,30), maxdepth * 2 / 3));
profileYAxis->updateTicks();
- timeAxis->setMaximum(pInfo.maxtime);
+ timeAxis->setMaximum(maxtime);
timeAxis->updateTicks();
dataModel->setDive(current_dive, pInfo);