From 25a52056c681f956d9c23bf1116f35997bcab3d3 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 19 Nov 2013 20:08:46 -0200 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qt-ui') 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); -- cgit v1.2.3-70-g09d2