X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factionmodifytrim.cpp;h=f11d064a47604486009563d263f90a08baf25456;hb=92c8661cef41f1109908bf645c0a171e34680183;hp=efbc6a06289c850c69f0ece612983ac57040672b;hpb=16354e0421b316a62c6b9f7b0b4f3b8cf6f06284;p=architektonas diff --git a/src/actions/actionmodifytrim.cpp b/src/actions/actionmodifytrim.cpp index efbc6a0..f11d064 100644 --- a/src/actions/actionmodifytrim.cpp +++ b/src/actions/actionmodifytrim.cpp @@ -12,6 +12,7 @@ // Who When What // --- ---------- ----------------------------------------------------------- // JLH 05/22/2010 Added this text. :-) +// JLH 09/17/2010 Fixed preview/snapper rendering somewhat. Some bugs remain. // #include "actionmodifytrim.h" @@ -24,14 +25,16 @@ * @param both Trim both entities. */ ActionModifyTrim::ActionModifyTrim(EntityContainer & container, - GraphicView & graphicView, bool both): ActionInterface("Trim Entity", - container, graphicView) + GraphicView & graphicView, bool b): + ActionInterface("Trim Entity", container, graphicView), + limitEntity(NULL), limitCoord(false), trimEntity(NULL), trimCoord(false), + both(b) { - trimEntity = NULL; - trimCoord = Vector(false); - limitEntity = NULL; - limitCoord = Vector(false); - this->both = both; +// trimEntity = NULL; +// trimCoord = Vector(false); +// limitEntity = NULL; +// limitCoord = Vector(false); +// this->both = both; } ActionModifyTrim::~ActionModifyTrim() @@ -53,16 +56,17 @@ void ActionModifyTrim::trigger() if (trimEntity && trimEntity->isAtomic() && limitEntity) { Modification m(*container, graphicView); - m.trim(trimCoord, (AtomicEntity *)trimEntity, - limitCoord, limitEntity, both); + m.trim(trimCoord, (AtomicEntity *)trimEntity, limitCoord, limitEntity, + both); trimEntity = NULL; if (both) { limitEntity->setHighlighted(false); - graphicView->drawEntity(limitEntity); +// graphicView->drawEntity(limitEntity); setStatus(ChooseLimitEntity); + graphicView->redraw(); //hm. } else setStatus(ChooseTrimEntity); @@ -113,8 +117,9 @@ void ActionModifyTrim::mouseReleaseEvent(QMouseEvent * e) if (limitEntity) { limitEntity->setHighlighted(true); - graphicView->drawEntity(limitEntity); +// graphicView->drawEntity(limitEntity); setStatus(ChooseTrimEntity); + graphicView->redraw(); //hm. } break; @@ -122,7 +127,7 @@ void ActionModifyTrim::mouseReleaseEvent(QMouseEvent * e) trimCoord = mouse; trimEntity = se; - if (trimEntity != NULL && trimEntity->isAtomic()) + if (trimEntity && trimEntity->isAtomic()) trigger(); break; @@ -132,15 +137,17 @@ void ActionModifyTrim::mouseReleaseEvent(QMouseEvent * e) } else if (e->button() == Qt::RightButton) { - deletePreview(); - deleteSnapper(); +// deletePreview(); +// deleteSnapper(); - if (limitEntity != NULL) + if (limitEntity) { limitEntity->setHighlighted(false); - graphicView->drawEntity(limitEntity); +// graphicView->drawEntity(limitEntity); } + init(getStatus() - 1); + graphicView->redraw(); //hm. } } @@ -183,4 +190,3 @@ void ActionModifyTrim::updateToolBar() { DIALOGFACTORY->requestToolBar(RS2::ToolBarModify); } -