From bed0a043369bee847810ec7ed46470a59ca49174 Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 2 Dec 2019 12:20:59 +0300 Subject: [PATCH] Issue #3092: Do not relaunch editing on multi-selection if editing feature is still selected. --- src/PartSet/PartSet_SketcherMgr.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 695d8a0fe..bd4c35fae 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -414,7 +414,6 @@ void PartSet_SketcherMgr::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseE } // Init flyout point for radius rotation FeaturePtr aFeature = myCurrentSelection.begin().key(); - get2dPoint(theWnd, theEvent, myCurrentPoint); if (isSketcher) { if (aCanDrag) { @@ -444,14 +443,33 @@ void PartSet_SketcherMgr::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseE /// Internal edit should not be stored as editing operation as the result will be a /// creation operation, where previous selection should not be used(and will be cleared) myIsEditLaunching = !myModule->sketchReentranceMgr()->isInternalEditActive(); - aFOperation->commit(); + + std::shared_ptr aSPFeature = + std::dynamic_pointer_cast(aFOperation->feature()); + bool isRelaunchEditing = true; + if (aSPFeature->isExternal()) { + foreach(FeaturePtr aF, myCurrentSelection.keys()) { + FeaturePtr aProducerFeature = PartSet_Tools::findRefsToMeFeature(aF, + aSPFeature->getKind()); + if (aProducerFeature == aSPFeature) { + isRelaunchEditing = false; + break; + } + } + } + else + isRelaunchEditing = !myCurrentSelection.contains(aSPFeature); + + if (isRelaunchEditing) + aFOperation->commit(); if (aCanDrag) { myIsDragging = true; myDragDone = false; } myPreviousDrawModeEnabled = aViewer->enableDrawMode(false); - launchEditing(); + if (isRelaunchEditing) + launchEditing(); myIsEditLaunching = aPrevLaunchingState; if (aFeature.get() != NULL) { std::shared_ptr aSPFeature = -- 2.39.2