]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/rs_actiondrawline.cpp
Beginnings of new render path (Snapper)...
[architektonas] / src / actions / rs_actiondrawline.cpp
index c52fc44ed1c6bb782e5ab1b2ca3408cacc58e54e..1c1860af04f88143cb0a84b63d1590c1a1f6b484 100644 (file)
@@ -25,6 +25,10 @@ RS_ActionDrawLine::RS_ActionDrawLine(RS_EntityContainer & container, GraphicView
 {
        RS_DEBUG->print("RS_ActionDrawLine::RS_ActionDrawLine");
        reset();
+       //hm.
+       graphicView.snapper.SetContainer(&container);
+       graphicView.snapper.SetGraphicView(&graphicView);
+       graphicView.snapper.SetVisible();
        RS_DEBUG->print("RS_ActionDrawLine::RS_ActionDrawLine: OK");
 }
 
@@ -77,13 +81,13 @@ void RS_ActionDrawLine::trigger()
                document->endUndoCycle();
        }
 
-       deleteSnapper();                        // XOR off of screen
-       graphicView->moveRelativeZero(Vector(0.0, 0.0));
+//     deleteSnapper();                        // XOR off of screen
+//     graphicView->moveRelativeZero(Vector(0.0, 0.0));
 //This is unnecessary, because we added this to the container...
 //#warning "!!! Here's the trouble... Trying to draw direct !!!"
 //     graphicView->drawEntity(line);
        graphicView->moveRelativeZero(line->getEndpoint());
-       drawSnapper();                          // XOR on screen
+//     drawSnapper();                          // XOR on screen
        RS_DEBUG->print("RS_ActionDrawLine::trigger(): line added: %d", line->getId());
 }
 
@@ -92,7 +96,9 @@ void RS_ActionDrawLine::mouseMoveEvent(QMouseEvent * e)
        RS_DEBUG->print("RS_ActionDrawLine::mouseMoveEvent begin");
 
        RS_DEBUG->print("RS_ActionDrawLine::mouseMoveEvent: snap point");
-       Vector mouse = snapPoint(e);
+//This used to draw the snapper, but now that's defunct... so, !!! FIX !!!
+//     Vector mouse = snapPoint(e);
+       Vector mouse = graphicView->snapper.snapPoint(e);
        RS_DEBUG->print("RS_ActionDrawLine::mouseMoveEvent: snap point: OK");
 
        if (getStatus() == SetEndpoint && data.startpoint.valid)
@@ -108,6 +114,8 @@ void RS_ActionDrawLine::mouseMoveEvent(QMouseEvent * e)
                xorPreview();                   // XOR on screen
        }
 
+       //hm.
+       graphicView->redraw();
        RS_DEBUG->print("RS_ActionDrawLine::mouseMoveEvent end");
 }
 
@@ -122,7 +130,7 @@ void RS_ActionDrawLine::mouseReleaseEvent(QMouseEvent * e)
        {
                deletePreview();                // XOR off of screen
                clearPreview();                 // Remove entities from the container
-               deleteSnapper();                // XOR off of screen
+//             deleteSnapper();                // XOR off of screen
                init(getStatus() - 1);
        }
 }