X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factiondrawarctangential.cpp;h=a8a16c6d505c14c25a1517e4625a86fdb19e2163;hb=5adb444f3e523d3fd028617ced72d1ea6661db21;hp=f1691fcf6fc051780e875b49ef6c50b2979a5270;hpb=16354e0421b316a62c6b9f7b0b4f3b8cf6f06284;p=architektonas diff --git a/src/actions/actiondrawarctangential.cpp b/src/actions/actiondrawarctangential.cpp index f1691fc..a8a16c6 100644 --- a/src/actions/actiondrawarctangential.cpp +++ b/src/actions/actiondrawarctangential.cpp @@ -12,6 +12,7 @@ // Who When What // --- ---------- ----------------------------------------------------------- // JLH 06/03/2010 Added this text. :-) +// JLH 09/17/2010 Fixed preview/snapper rendering. // #include "actiondrawarctangential.h" @@ -22,8 +23,8 @@ #include "graphicview.h" #include "preview.h" -ActionDrawArcTangential::ActionDrawArcTangential(EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw arcs tangential", - container, graphicView) +ActionDrawArcTangential::ActionDrawArcTangential(EntityContainer & container, GraphicView & graphicView): + ActionInterface("Draw arcs tangential", container, graphicView) { reset(); } @@ -68,26 +69,26 @@ void ActionDrawArcTangential::trigger() container->addEntity(arc); // upd. undo list: - if (document != NULL) + if (document) { document->startUndoCycle(); document->addUndoable(arc); document->endUndoCycle(); } - deleteSnapper(); - graphicView->moveRelativeZero(Vector(0.0, 0.0)); - graphicView->drawEntity(arc); +// deleteSnapper(); +// graphicView->moveRelativeZero(Vector(0.0, 0.0)); +// graphicView->drawEntity(arc); graphicView->moveRelativeZero(arc->getCenter()); - drawSnapper(); - +// drawSnapper(); + graphicView->redraw(); //hm. setStatus(SetBaseEntity); reset(); } void ActionDrawArcTangential::preparePreview() { - if (baseEntity != NULL && point.valid) + if (baseEntity && point.valid) { Vector startPoint; double direction; @@ -129,6 +130,9 @@ void ActionDrawArcTangential::mouseMoveEvent(QMouseEvent * e) // clearPreview(); // preview->addEntity(arc); // drawPreview(); + graphicView->preview.clear(); + graphicView->preview.addEntity(new Arc(&(graphicView->preview), data)); + graphicView->redraw(); } break; @@ -149,7 +153,7 @@ void ActionDrawArcTangential::mouseReleaseEvent(QMouseEvent * e) Vector coord = graphicView->toGraph(e->x(), e->y()); Entity * entity = catchEntity(coord, RS2::ResolveAll); - if (entity != NULL) + if (entity) { if (entity->isAtomic()) { @@ -184,9 +188,10 @@ void ActionDrawArcTangential::mouseReleaseEvent(QMouseEvent * e) } else if (e->button() == Qt::RightButton) { - deletePreview(); - deleteSnapper(); +// deletePreview(); + // deleteSnapper(); init(getStatus() - 1); + graphicView->redraw(); //hm. } }