From 759328282bc79a81b09e42803c15dfe3da3245e4 Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 3 Apr 2017 13:22:22 +0300 Subject: [PATCH] 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. --- src/PartSet/PartSet_SketcherMgr.cpp | 4 ++++ src/SketchPlugin/SketchPlugin_Line.cpp | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) 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; } -- 2.39.2