profile: rectify animSpeed data flow

The cartesian axes use animSpeed to animate changes. Instead
of passing down the value to the respective functions, the
speed was stored in the ProfileScene and the axes would
access it there. Very messy. Let's just pass down the speed.

There still are back-references from the axes to the scene,
notably to place labels "outside" of the scene. Let's try
to remove them later.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-08-03 10:32:08 +02:00 committed by Dirk Hohndel
parent d19b095db1
commit 1327043d6e
5 changed files with 52 additions and 52 deletions

View file

@ -44,12 +44,12 @@ public:
qreal posAtValue(qreal value) const;
void setColor(const QColor &color);
void setTextColor(const QColor &color);
void animateChangeLine(const QLineF &newLine);
void animateChangeLine(const QLineF &newLine, int animSpeed);
void setTextVisible(bool arg1);
void setLinesVisible(bool arg1);
void setLineSize(qreal lineSize);
void setLine(const QLineF& line);
virtual void updateTicks(color_index_t color = TIME_GRID);
virtual void updateTicks(int animSpeed, color_index_t color = TIME_GRID);
signals:
void sizeChanged();
@ -87,7 +87,7 @@ class TimeAxis : public DiveCartesianAxis {
Q_OBJECT
public:
using DiveCartesianAxis::DiveCartesianAxis;
void updateTicks(color_index_t color = TIME_GRID) override;
void updateTicks(int animSpeed, color_index_t color = TIME_GRID) override;
private:
QString textForValue(double value) const override;
QColor colorForValue(double value) const override;
@ -105,7 +105,7 @@ class PartialGasPressureAxis : public DiveCartesianAxis {
Q_OBJECT
public:
PartialGasPressureAxis(const DivePlotDataModel &model, double fontPrintScale, ProfileScene &scene);
void update();
void update(int animSpeed);
private:
const DivePlotDataModel &model;
};