From 45813562e266cf8e58ea9cb04f655bbb542a555e Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Sun, 31 May 2015 22:55:45 +0200 Subject: Make every line subclass editable --- interactioncanvas.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'interactioncanvas.cpp') 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) { -- cgit v1.2.3-70-g09d2