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>
This commit is contained in:
Tomaz Canabrava 2014-01-15 18:03:58 -02:00 committed by Dirk Hohndel
parent e9f3d652e8
commit 6f5974f3e8

View file

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