From: mpv Date: Mon, 12 Oct 2015 08:39:18 +0000 (+0300) Subject: Fix for the problem of activation/deactivation part and current feature to sub-elemen... X-Git-Tag: V_1.4.0_demo2~10^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=197e17b93123ff9ab13a31cc8b4fa79b00622b3a;p=modules%2Fshaper.git Fix for the problem of activation/deactivation part and current feature to sub-element of sketch setting. --- diff --git a/src/Model/Model_Session.cpp b/src/Model/Model_Session.cpp index ea5375afb..172b7d3ff 100644 --- a/src/Model/Model_Session.cpp +++ b/src/Model/Model_Session.cpp @@ -219,6 +219,15 @@ std::shared_ptr Model_Session::activeDocument() static void makeCurrentLast(std::shared_ptr theDoc) { if (theDoc.get()) { FeaturePtr aLast = std::dynamic_pointer_cast(theDoc)->lastFeature(); + // if last is nested into something else, make this something else as last: + // otherwise it will look like edition of sub-element, so, the main will be disabled + if (aLast.get()) { + CompositeFeaturePtr aMain = ModelAPI_Tools::compositeOwner(aLast); + while(aMain.get()) { + aLast = aMain; + aMain = ModelAPI_Tools::compositeOwner(aLast); + } + } theDoc->setCurrentFeature(aLast, false); } }