From 6f5974f3e824a62f3cbbe197f7dc1cc320a1da4f Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 15 Jan 2014 18:03:58 -0200 Subject: Use the same methods as the old profile to discover the boundaries. This method gathers information about the max and minimum sizes of the cartesian axis that we should plot. It's still a bit cumberstone for my taste, but this shouldn't be a problem. I think we need to rework the 'Zoomed' version of it, since zoom or without zoom, we should be good to go using the QGraphicsView. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'qt-ui') 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 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(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); -- cgit v1.2.3-70-g09d2