diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-01-15 18:03:58 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-17 06:16:07 +0700 |
commit | 6f5974f3e824a62f3cbbe197f7dc1cc320a1da4f (patch) | |
tree | 2d8825d978b4e11dea813cc42ef983b7346994d6 | |
parent | e9f3d652e8b060419778d5578c1ad019d65c5879 (diff) | |
download | subsurface-6f5974f3e824a62f3cbbe197f7dc1cc320a1da4f.tar.gz |
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 <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 6 |
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); |