mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
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>
This commit is contained in:
parent
f5be24609a
commit
25a52056c6
1 changed files with 1 additions and 1 deletions
|
@ -493,7 +493,7 @@ void DivePlannerGraphics::drawProfile()
|
||||||
continue;
|
continue;
|
||||||
DiveHandler *h = handles.at(i);
|
DiveHandler *h = handles.at(i);
|
||||||
h->setPos(timeLine->posAtValue(dp.time / 60), depthLine->posAtValue(dp.depth));
|
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();
|
QPointF p2 = handles[i]->pos();
|
||||||
QLineF line(p1, p2);
|
QLineF line(p1, p2);
|
||||||
QPointF pos = line.pointAt(0.5);
|
QPointF pos = line.pointAt(0.5);
|
||||||
|
|
Loading…
Reference in a new issue