summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divecartesianaxis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile/divecartesianaxis.cpp')
-rw-r--r--qt-ui/profile/divecartesianaxis.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp
index fdcfff3c6..505b60d7e 100644
--- a/qt-ui/profile/divecartesianaxis.cpp
+++ b/qt-ui/profile/divecartesianaxis.cpp
@@ -184,7 +184,8 @@ qreal DiveCartesianAxis::posAtValue(qreal value)
double size = max - min;
// unused for now:
// double distanceFromOrigin = value - min;
- double percent = (value - min) / size;
+ double percent = IS_FP_SAME(min,max) ? 0.0 : (value - min) / size;
+
double realSize = orientation == LeftToRight || orientation == RightToLeft?
m.x2() - m.x1() :