summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-11-19 20:08:46 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-19 15:41:11 -0800
commit25a52056c681f956d9c23bf1116f35997bcab3d3 (patch)
treeeae8f9a2c58ddf81a323ab6c312ebf8d67176b66
parentf5be24609ab0c35bca54c74b1371e047260cbad4 (diff)
downloadsubsurface-25a52056c681f956d9c23bf1116f35997bcab3d3.tar.gz
Fixes positioning the first Gas Label on the add dive profile.
We didn't take into account that last == first when checking for the first item on the list. Now the gas is correctly placed on screen. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/diveplanner.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 89e744e31..21d9aa236 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -493,7 +493,7 @@ void DivePlannerGraphics::drawProfile()
continue;
DiveHandler *h = handles.at(i);
h->setPos(timeLine->posAtValue(dp.time / 60), depthLine->posAtValue(dp.depth));
- QPointF p1 = handles[last]->pos();
+ QPointF p1 = (last == i) ? QPointF(timeLine->posAtValue(0), depthLine->posAtValue(0)) : handles[last]->pos();
QPointF p2 = handles[i]->pos();
QLineF line(p1, p2);
QPointF pos = line.pointAt(0.5);