diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-05-31 22:55:45 +0200 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-05-31 22:55:45 +0200 |
| commit | 45813562e266cf8e58ea9cb04f655bbb542a555e (patch) | |
| tree | c8864c50a1bd84ec8f2e8e527e71c9825fabf92a /interactioncanvas.cpp | |
| parent | 16cdefa1a8546d23efc357010e62c7c031319e56 (diff) | |
| download | GUI_SS2015-45813562e266cf8e58ea9cb04f655bbb542a555e.tar.gz GUI_SS2015-45813562e266cf8e58ea9cb04f655bbb542a555e.zip | |
Make every line subclass editable
Diffstat (limited to 'interactioncanvas.cpp')
| -rw-r--r-- | interactioncanvas.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/interactioncanvas.cpp b/interactioncanvas.cpp index 28b8e74..80a4317 100644 --- a/interactioncanvas.cpp +++ b/interactioncanvas.cpp @@ -42,8 +42,6 @@ void InteractionCanvas::addLine() void InteractionCanvas::addRectangle() { Line *tmpLine = new Rectangle(); - tmpLine->setP1(QPoint(10, 50)); - tmpLine->setP2(QPoint(30, 70)); addNewLine(tmpLine); m_NewLine = NULL; m_Lines.append(tmpLine); @@ -53,8 +51,6 @@ void InteractionCanvas::addRectangle() void InteractionCanvas::addEllipse() { Line *tmpLine = new Ellipse(); - tmpLine->setP1(QPoint(10, 50)); - tmpLine->setP2(QPoint(30, 70)); addNewLine(tmpLine); m_NewLine = NULL; m_Lines.append(tmpLine); @@ -64,8 +60,6 @@ void InteractionCanvas::addEllipse() void InteractionCanvas::addPolygon() { Line *tmpLine = new Polygon(); - tmpLine->setP1(QPoint(10, 50)); - tmpLine->setP2(QPoint(30, 70)); addNewLine(tmpLine); m_NewLine = NULL; m_Lines.append(tmpLine); @@ -80,8 +74,7 @@ void InteractionCanvas::mouseMoveEvent(QMouseEvent *mouseEvent) { if(m_SelectedLine) { - m_SelectedLine->setP1(m_SelectedLine->p1()+(mouseEvent->pos()-m_LastMousePosition)); - m_SelectedLine->setP2(m_SelectedLine->p2()+(mouseEvent->pos()-m_LastMousePosition)); + m_SelectedLine->move(m_LastMousePosition, mouseEvent->pos()); } if(m_NewLine) { |
