From d17a8b124d6800959675741a45434f8dbe8a50ba Mon Sep 17 00:00:00 2001 From: Shamus Hammons Date: Tue, 8 Nov 2011 10:26:06 +0000 Subject: [PATCH] Small refinements to Add Line tool. --- src/drawlineaction.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/drawlineaction.cpp b/src/drawlineaction.cpp index 867970d..65b9fc1 100644 --- a/src/drawlineaction.cpp +++ b/src/drawlineaction.cpp @@ -34,6 +34,7 @@ DrawLineAction::~DrawLineAction() /*virtual*/ void DrawLineAction::Draw(Painter * painter) { // Need to fix pen colors, etc... + // I think stuff like crosshairs should be done in the DrawingView, tho if (state == FIRST_POINT) { painter->DrawPoint(p1.x, p1.y); @@ -63,14 +64,18 @@ DrawLineAction::~DrawLineAction() /*virtual*/ void DrawLineAction::MouseReleased(void) { if (state == FIRST_POINT) + { + p2 = p1; state = NEXT_POINT; + } else if (state == NEXT_POINT) { - // We create the new object here, and then pass it off to the document. + // We create the new object here, and then pass it off to the + // DrawingView which stuffs it into the document. line = new Line(p1, p2); // We don't need no stinkin' sentinels, when we have signals & slots! emit ObjectReady(line); - + p1 = p2; } } -- 2.37.2