From 197e17b93123ff9ab13a31cc8b4fa79b00622b3a Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 12 Oct 2015 11:39:18 +0300 Subject: [PATCH] Fix for the problem of activation/deactivation part and current feature to sub-element of sketch setting. --- src/Model/Model_Session.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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); } } -- 2.39.2