From: nds Date: Mon, 3 Apr 2017 10:22:22 +0000 (+0300) Subject: Line reentrant creation: do not create line if point is clicked in viewer, but releas... X-Git-Tag: V_2.7.0~94 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=759328282bc79a81b09e42803c15dfe3da3245e4;p=modules%2Fshaper.git Line reentrant creation: do not create line if point is clicked in viewer, but released out of viewer. In this case, the line will not be displayed until Sketch is applyed. --- diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 1fd62e95d..05378d4a5 100755 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -428,6 +428,10 @@ void PartSet_SketcherMgr::onMouseReleased(ModuleBase_IViewWindow* theWnd, QMouse if (myModule->sketchReentranceMgr()->processMouseReleased(theWnd, theEvent)) return; + // if mouse is pressed when it was over view and at release the mouse is out of view, do nothing + if (!myIsMouseOverViewProcessed) + return; + ModuleBase_IWorkshop* aWorkshop = myModule->workshop(); ModuleBase_IViewer* aViewer = aWorkshop->viewer(); if (!aViewer->canDragByMouse()) diff --git a/src/SketchPlugin/SketchPlugin_Line.cpp b/src/SketchPlugin/SketchPlugin_Line.cpp index 99d69ce67..5760a866f 100644 --- a/src/SketchPlugin/SketchPlugin_Line.cpp +++ b/src/SketchPlugin/SketchPlugin_Line.cpp @@ -111,11 +111,6 @@ std::string SketchPlugin_Line::processEvent(const std::shared_ptrattribute(SketchPlugin_Line::START_ID())); aNPoint->setValue(aSPoint->x(), aSPoint->y()); SketchPlugin_ConstraintCoincidence::createCoincidenceFeature(sketch(), aSPoint, aNPoint); - - aNPoint = std::dynamic_pointer_cast( - aSFData->attribute(SketchPlugin_Line::END_ID())); - aNPoint->setValue(aSPoint->x(), aSPoint->y()); - } return aFilledAttributeName; }