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>
This commit is contained in:
Dirk Hohndel 2014-02-10 20:31:12 -08:00
parent d49acdb3c0
commit 2bd2df0349

View file

@ -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;