From: vsv Date: Mon, 2 Dec 2019 09:20:59 +0000 (+0300) Subject: Issue #3092: Do not relaunch editing on multi-selection if editing feature is still... X-Git-Tag: V9_5_0a1~139 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bed0a043369bee847810ec7ed46470a59ca49174;p=modules%2Fshaper.git Issue #3092: Do not relaunch editing on multi-selection if editing feature is still selected. --- 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 =