From 2bd2df0349154b83f2125da70d4c581ac2c04534 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 10 Feb 2014 20:31:12 -0800 Subject: 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 --- qt-ui/profile/divecartesianaxis.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qt-ui/profile') 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; -- cgit v1.2.3-70-g09d2