summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divecartesianaxis.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-10 20:31:12 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-11 12:34:42 -0800
commit2bd2df0349154b83f2125da70d4c581ac2c04534 (patch)
tree061168c72a1ebfbfccc878fa993c3b90dfd62f1c /qt-ui/profile/divecartesianaxis.cpp
parentd49acdb3c0298ab3c2493db70d81c4731d6f3fcb (diff)
downloadsubsurface-2bd2df0349154b83f2125da70d4c581ac2c04534.tar.gz
Fix bug in logic expression
Yes, the old code made perfect sense when you read it - except the C++ compiler turned it into something quite different from what was intended. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/divecartesianaxis.cpp')
-rw-r--r--qt-ui/profile/divecartesianaxis.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp
index 143b0f90c..9a4966fef 100644
--- a/qt-ui/profile/divecartesianaxis.cpp
+++ b/qt-ui/profile/divecartesianaxis.cpp
@@ -190,7 +190,7 @@ void DiveCartesianAxis::setTickInterval(double i)
qreal DiveCartesianAxis::valueAt(const QPointF& p)
{
QLineF m = line();
- double retValue = orientation == LeftToRight || RightToLeft?
+ double retValue = (orientation == LeftToRight || orientation == RightToLeft) ?
max * (p.x() - m.x1()) / (m.x2() - m.x1()) :
max * (p.y() - m.y1()) / (m.y2() - m.y1());
return retValue;