mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 20:33:24 +00:00
Fix an issue added in the last commit
The last commit made the time and all other axis behave like the time axis. Not cool. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
9f6ebf96a7
commit
607bf47989
2 changed files with 14 additions and 3 deletions
|
@ -110,7 +110,6 @@ void DiveCartesianAxis::updateTicks()
|
||||||
} else {
|
} else {
|
||||||
labels[i]->animateMoveTo(m.x1() - tickSize, childPos);
|
labels[i]->animateMoveTo(m.x1() - tickSize, childPos);
|
||||||
}
|
}
|
||||||
labels[i]->setVisible( i % 2 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add's the rest of the needed Ticks / Text.
|
// Add's the rest of the needed Ticks / Text.
|
||||||
|
@ -143,7 +142,6 @@ void DiveCartesianAxis::updateTicks()
|
||||||
label->animateMoveTo(m.x1() - tickSize, childPos);
|
label->animateMoveTo(m.x1() - tickSize, childPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
label->setVisible( i % 2 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,6 +288,16 @@ QString TimeAxis::textForValue(double value)
|
||||||
return QString::number(nr);
|
return QString::number(nr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TimeAxis::updateTicks()
|
||||||
|
{
|
||||||
|
DiveCartesianAxis::updateTicks();
|
||||||
|
if (maximum() > 600){
|
||||||
|
for(int i = 0; i < labels.count(); i++){
|
||||||
|
labels[i]->setVisible(i % 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QString TemperatureAxis::textForValue(double value)
|
QString TemperatureAxis::textForValue(double value)
|
||||||
{
|
{
|
||||||
return QString::number(mkelvin_to_C( (int) value));
|
return QString::number(mkelvin_to_C( (int) value));
|
||||||
|
|
|
@ -36,7 +36,7 @@ public:
|
||||||
void animateChangeLine(const QLineF& newLine);
|
void animateChangeLine(const QLineF& newLine);
|
||||||
int unitSystem;
|
int unitSystem;
|
||||||
public slots:
|
public slots:
|
||||||
void updateTicks();
|
virtual void updateTicks();
|
||||||
signals:
|
signals:
|
||||||
void sizeChanged();
|
void sizeChanged();
|
||||||
void maxChanged();
|
void maxChanged();
|
||||||
|
@ -66,6 +66,9 @@ private slots:
|
||||||
};
|
};
|
||||||
|
|
||||||
class TimeAxis : public DiveCartesianAxis {
|
class TimeAxis : public DiveCartesianAxis {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
virtual void updateTicks();
|
||||||
protected:
|
protected:
|
||||||
QString textForValue(double value);
|
QString textForValue(double value);
|
||||||
QColor colorForValue(double value);
|
QColor colorForValue(double value);
|
||||||
|
|
Loading…
Add table
Reference in a new issue