Added a 'Depth' Axis that knows how to add its strings on screen.
The CartesianAxis used a simple method to put things on screen which is wrong for almost any case besides the 'current value here' since we store things in milimeters on the axis, we need to convert those to meters before showing on the profile. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
90fc7a23f2
commit
67f2c0bcaa
@ -178,3 +178,8 @@ void DiveCartesianAxis::setColor(const QColor& color)
|
||||
defaultPen.setCosmetic(true);
|
||||
setPen(defaultPen);
|
||||
}
|
||||
|
||||
QString DepthAxis::textForValue(double value)
|
||||
{
|
||||
return get_depth_string(value, false, false);
|
||||
}
|
||||
|
||||
@ -43,4 +43,9 @@ protected:
|
||||
QColor textColor;
|
||||
};
|
||||
|
||||
class DepthAxis : public DiveCartesianAxis {
|
||||
protected:
|
||||
QString textForValue(double value);
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
x
Reference in New Issue
Block a user