profile: avoid double recalculation of tick positions

The ticks were recalculated twice per plotDive() call:
1) When updating the position of the axes in updateChangeLine()
2) After setting the bounds in plotDive() via setBounds()

Remove the first instance. updateChangeLine() is called in
only one place [from plotDive()] and therefore, the recalculation
is always redundant. Moreover, rename the function to setPosition(),
since it doesn't do any animation at all.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-09-28 10:32:41 +02:00 committed by Dirk Hohndel
parent b0faf2e4b1
commit 99c4741508
4 changed files with 10 additions and 19 deletions

View file

@ -60,7 +60,7 @@ private:
PartialPressureGasItem *createPPGas(int column, color_index_t color, color_index_t colorAlert,
const double *thresholdSettingsMin, const double *thresholdSettingsMax);
void updateVisibility(bool diveHasHeartBeat); // Update visibility of non-interactive chart features according to preferences
void updateAxes(bool instant, bool diveHasHeartBeat); // Update axes according to preferences
void updateAxes(bool diveHasHeartBeat); // Update axes according to preferences
friend class ProfileWidget2; // For now, give the ProfileWidget full access to the objects on the scene
double dpr; // Device Pixel Ratio. A DPR of one corresponds to a "standard" PC screen.