mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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>
This commit is contained in:
parent
1e4d360d0c
commit
43657d9944
1 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue