]> Shamusworld >> Repos - architektonas/blobdiff - src/drawlineaction.cpp
Fixed Container loading, informative display.
[architektonas] / src / drawlineaction.cpp
index 780ad58a66c3fd49f9e563f3156aa3af29ffa98f..d4b35db336ae70c35bc8f7c6e69ca199d7e7426f 100644 (file)
@@ -26,6 +26,7 @@ DrawLineAction::DrawLineAction(): state(0), line(NULL)
 {
 }
 
+
 DrawLineAction::~DrawLineAction()
 {
 }
@@ -44,9 +45,14 @@ DrawLineAction::~DrawLineAction()
        {
                painter->DrawLine(p1, p2);
                painter->DrawHandle(p2);
+
+               QString text = tr("Length: %1 in.");
+               text = text.arg(Vector::Magnitude(p1, p2));
+               painter->DrawInformativeText(text);
        }
 }
 
+
 /*virtual*/ void DrawLineAction::MouseDown(Vector point)
 {
        if (state == FIRST_POINT)
@@ -55,6 +61,7 @@ DrawLineAction::~DrawLineAction()
                p2 = point;
 }
 
+
 /*virtual*/ void DrawLineAction::MouseMoved(Vector point)
 {
        if (state == FIRST_POINT)
@@ -63,6 +70,7 @@ DrawLineAction::~DrawLineAction()
                p2 = point;
 }
 
+
 /*virtual*/ void DrawLineAction::MouseReleased(void)
 {
        if (state == FIRST_POINT)
@@ -78,6 +86,8 @@ DrawLineAction::~DrawLineAction()
                // We don't need no stinkin' sentinels, when we have signals & slots!
                emit ObjectReady(line);
 
-               p1 = p2;
+//             p1 = p2;
+               state = FIRST_POINT;
        }
 }
+