mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 17:23:23 +00:00
profile: remove color parameter of DiveCartesianAxis::updateTicks()
The grid color is saved on construction, no need to pass a parameter. Note that this fixes a bug where the color was passed as animation speed. Ooops. That's what you get from weak typing. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
277b9234ab
commit
41c23dcb22
3 changed files with 8 additions and 8 deletions
|
@ -141,7 +141,7 @@ double DiveCartesianAxis::height() const
|
|||
return fm.height() + labelSpaceVertical * dpr;
|
||||
}
|
||||
|
||||
void DiveCartesianAxis::updateTicks(int animSpeed, color_index_t color)
|
||||
void DiveCartesianAxis::updateTicks(int animSpeed)
|
||||
{
|
||||
if (!changed && !printMode)
|
||||
return;
|
||||
|
@ -233,7 +233,7 @@ void DiveCartesianAxis::updateTicks(int animSpeed, color_index_t color)
|
|||
}
|
||||
DiveLineItem *line = new DiveLineItem(this);
|
||||
QPen pen = gridPen();
|
||||
pen.setBrush(getColor(color));
|
||||
pen.setBrush(getColor(gridColor));
|
||||
line->setPen(pen);
|
||||
line->setZValue(0);
|
||||
lines.push_back(line);
|
||||
|
@ -380,9 +380,9 @@ QString TimeAxis::textForValue(double value) const
|
|||
return QString::number(nr);
|
||||
}
|
||||
|
||||
void TimeAxis::updateTicks(int animSpeed, color_index_t color)
|
||||
void TimeAxis::updateTicks(int animSpeed)
|
||||
{
|
||||
DiveCartesianAxis::updateTicks(animSpeed, color);
|
||||
DiveCartesianAxis::updateTicks(animSpeed);
|
||||
if (maximum() > 600) {
|
||||
for (int i = 0; i < labels.count(); i++) {
|
||||
labels[i]->setVisible(i % 2);
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
void setLinesVisible(bool arg1);
|
||||
void setLineSize(qreal lineSize);
|
||||
void setLine(const QLineF& line);
|
||||
virtual void updateTicks(int animSpeed, color_index_t color = TIME_GRID);
|
||||
virtual void updateTicks(int animSpeed);
|
||||
double width() const; // only for vertical axes
|
||||
double height() const; // only for horizontal axes
|
||||
|
||||
|
@ -94,7 +94,7 @@ class TimeAxis : public DiveCartesianAxis {
|
|||
Q_OBJECT
|
||||
public:
|
||||
using DiveCartesianAxis::DiveCartesianAxis;
|
||||
void updateTicks(int animSpeed, color_index_t color = TIME_GRID) override;
|
||||
void updateTicks(int animSpeed) override;
|
||||
private:
|
||||
QString textForValue(double value) const override;
|
||||
QColor colorForValue(double value) const override;
|
||||
|
|
|
@ -530,14 +530,14 @@ void ProfileScene::plotDive(const struct dive *dIn, int dcIn, DivePlannerPointsM
|
|||
heartBeatAxis->setMinimum(heartBeatAxisMin);
|
||||
heartBeatAxis->setMaximum(heartBeatAxisMax + 1);
|
||||
heartBeatAxis->setTickInterval(heartBeatAxisTick);
|
||||
heartBeatAxis->updateTicks(HR_AXIS); // this shows the ticks
|
||||
heartBeatAxis->updateTicks(animSpeed);
|
||||
}
|
||||
heartBeatAxis->setVisible(prefs.hrgraph && plotInfo.maxhr);
|
||||
|
||||
percentageAxis->setMinimum(0);
|
||||
percentageAxis->setMaximum(100);
|
||||
percentageAxis->setVisible(false);
|
||||
percentageAxis->updateTicks(HR_AXIS);
|
||||
percentageAxis->updateTicks(animSpeed);
|
||||
|
||||
if (calcMax)
|
||||
timeAxis->setMaximum(maxtime);
|
||||
|
|
Loading…
Add table
Reference in a new issue