diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-06-21 16:12:04 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-06-21 16:12:04 -0300 |
commit | 43657d99442e4b33f6df502d16e76a8b577b1381 (patch) | |
tree | 211252819b10aabbd85a9d037084f2b45985b0a2 | |
parent | 1e4d360d0c12969477122ecf72e6a4e6686142f3 (diff) | |
download | subsurface-43657d99442e4b33f6df502d16e76a8b577b1381.tar.gz |
Makes the first and last line of the plot inside of the boundingrect
This patch makes the first line and the last line of the plot
inside of the boundingRect defined by the timeLine and depthLine
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
-rw-r--r-- | qt-ui/diveplanner.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index bc774cc83..65be6f608 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -62,7 +62,9 @@ void DivePlannerGraphics::mouseDoubleClickEvent(QMouseEvent* event) handles << item; if (lines.empty()){ - QGraphicsLineItem *first = new QGraphicsLineItem(0,0, mappedPos.x(), mappedPos.y()); + double xpos = timeLine->posAtValue(0); + double ypos = depthLine->posAtValue(0); + QGraphicsLineItem *first = new QGraphicsLineItem(xpos,ypos, mappedPos.x(), mappedPos.y()); item->from = first; lines.push_back(first); create_deco_stop(); @@ -116,7 +118,9 @@ void DivePlannerGraphics::create_deco_stop() // Create all 'deco' GraphicsLineItems and put it on the canvas.This following three lines will // most probably need to enter on a loop. - QGraphicsLineItem *item = new QGraphicsLineItem(handles.last()->x(), handles.last()->y(), 100, 0); + double xpos = timeLine->posAtValue(timeLine->maximum()); + double ypos = depthLine->posAtValue(depthLine->minimum()); + QGraphicsLineItem *item = new QGraphicsLineItem(handles.last()->x(), handles.last()->y(), xpos, ypos); scene()->addItem(item); lines << item; } |