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:
Tomaz Canabrava 2014-01-15 10:54:33 -02:00 committed by Dirk Hohndel
parent 90fc7a23f2
commit 67f2c0bcaa
2 changed files with 10 additions and 0 deletions

View file

@ -178,3 +178,8 @@ void DiveCartesianAxis::setColor(const QColor& color)
defaultPen.setCosmetic(true); defaultPen.setCosmetic(true);
setPen(defaultPen); setPen(defaultPen);
} }
QString DepthAxis::textForValue(double value)
{
return get_depth_string(value, false, false);
}

View file

@ -43,4 +43,9 @@ protected:
QColor textColor; QColor textColor;
}; };
class DepthAxis : public DiveCartesianAxis {
protected:
QString textForValue(double value);
};
#endif #endif