From 45fbdf373a9f557aed7a7487b0f703e5592bffa1 Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 3 Nov 2015 14:37:14 +0300 Subject: [PATCH] myClickedPoint should not filled if the reentrant manager is active. Wrong case: create line, 1,2nd clicks, 'edition' mode, activate the 1st control. The value is modified to the current clicked. Edit operation - reentrant manager should not be active. --- src/PartSet/PartSet_SketcherMgr.cpp | 6 +++--- src/PartSet/PartSet_SketcherReetntrantMgr.cpp | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index ff37f0462..fb0d9bb39 100755 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -299,14 +299,14 @@ void PartSet_SketcherMgr::onAfterValuesChangedInPropertyPanel() void PartSet_SketcherMgr::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent) { + if (myModule->sketchReentranceMgr()->processMousePressed(theWnd, theEvent)) + return; + get2dPoint(theWnd, theEvent, myClickedPoint); if (!(theEvent->buttons() & Qt::LeftButton)) return; - if (myModule->sketchReentranceMgr()->processMousePressed(theWnd, theEvent)) - return; - // Clear dragging mode myIsDragging = false; diff --git a/src/PartSet/PartSet_SketcherReetntrantMgr.cpp b/src/PartSet/PartSet_SketcherReetntrantMgr.cpp index fbb653b4c..6b6c356d1 100755 --- a/src/PartSet/PartSet_SketcherReetntrantMgr.cpp +++ b/src/PartSet/PartSet_SketcherReetntrantMgr.cpp @@ -261,10 +261,19 @@ bool PartSet_SketcherReetntrantMgr::canBeCommittedByPreselection() bool PartSet_SketcherReetntrantMgr::isActiveMgr() const { - PartSet_SketcherMgr* aSketcherMgr = module()->sketchMgr(); ModuleBase_Operation* aCurrentOperation = myWorkshop->currentOperation(); - return PartSet_SketcherMgr::isSketchOperation(aCurrentOperation) || - PartSet_SketcherMgr::isNestedSketchOperation(aCurrentOperation); + + bool anActive = PartSet_SketcherMgr::isSketchOperation(aCurrentOperation); + if (!anActive) { + anActive = PartSet_SketcherMgr::isNestedSketchOperation(aCurrentOperation); + if (anActive) { // the manager is not active when the current operation is a usual Edit + ModuleBase_OperationFeature* aFOperation = dynamic_cast + (myWorkshop->currentOperation()); + if (aFOperation->isEditOperation()) + anActive = myIsInternalEditOperation; + } + } + return anActive; } void PartSet_SketcherReetntrantMgr::startInternalEdit(const std::string& thePreviousAttributeID) -- 2.39.2