From 67f2c0bcaa28f30acb92f84bd83ea4bb398b614c Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 15 Jan 2014 10:54:33 -0200 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/profile/divecartesianaxis.cpp | 5 +++++ qt-ui/profile/divecartesianaxis.h | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'qt-ui/profile') diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp index 358b85ef4..8b7269c35 100644 --- a/qt-ui/profile/divecartesianaxis.cpp +++ b/qt-ui/profile/divecartesianaxis.cpp @@ -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); +} diff --git a/qt-ui/profile/divecartesianaxis.h b/qt-ui/profile/divecartesianaxis.h index 1c8170ef4..9b5da4747 100644 --- a/qt-ui/profile/divecartesianaxis.h +++ b/qt-ui/profile/divecartesianaxis.h @@ -43,4 +43,9 @@ protected: QColor textColor; }; +class DepthAxis : public DiveCartesianAxis { +protected: + QString textForValue(double value); +}; + #endif \ No newline at end of file -- cgit v1.2.3-70-g09d2