mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: don't recalculate plot-info when zooming / scrolling
This is a potentially expensive operation (e.g. interpolation of pressure values), so don't recalculate the plot data for every redraw. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
6dfc2da8d0
commit
71629521b7
3 changed files with 10 additions and 7 deletions
|
@ -324,7 +324,7 @@ bool ProfileScene::isPointOutOfBoundaries(const QPointF &point) const
|
|||
}
|
||||
|
||||
void ProfileScene::plotDive(const struct dive *dIn, int dcIn, DivePlannerPointsModel *plannerModel,
|
||||
bool inPlanner, bool instant, bool calcMax, double zoom, double zoomedPosition)
|
||||
bool inPlanner, bool instant, bool keepPlotInfo, bool calcMax, double zoom, double zoomedPosition)
|
||||
{
|
||||
d = dIn;
|
||||
dc = dcIn;
|
||||
|
@ -363,7 +363,8 @@ void ProfileScene::plotDive(const struct dive *dIn, int dcIn, DivePlannerPointsM
|
|||
* shown.
|
||||
* create_plot_info_new() automatically frees old plot data.
|
||||
*/
|
||||
create_plot_info_new(d, get_dive_dc_const(d, dc), &plotInfo, !calcMax, planner_ds);
|
||||
if (!keepPlotInfo)
|
||||
create_plot_info_new(d, get_dive_dc_const(d, dc), &plotInfo, !calcMax, planner_ds);
|
||||
|
||||
bool hasHeartBeat = plotInfo.maxhr;
|
||||
// For mobile we might want to turn of some features that are normally shown.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue