From ef8794e9ab8985fc09219e3bcefdb2d069c49b6e Mon Sep 17 00:00:00 2001 From: mpv Date: Wed, 13 Feb 2019 14:13:52 +0300 Subject: [PATCH] Fix for the issue #2861. This issue 2861 is not a regression, but caused by order of parameters relative to other features. Here parameter l1 is created in sketch and when the sketch is current feature, new parameter was created just after, before l1. --- src/Model/Model_Document.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 2cbfce82c..337161e6f 100755 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -1025,6 +1025,14 @@ FeaturePtr Model_Document::addFeature(std::string theID, const bool theMakeCurre aCurrent = aSub; } } + // #2861: if the parameter is added, add it after parameters existing in the list + if (aCurrent.get() && aFeature->getKind() == "Parameter") { + int anIndex = kUNDEFINED_FEATURE_INDEX; + for(FeaturePtr aNextFeat = myObjs->nextFeature(aCurrent, anIndex); + aNextFeat.get() && aNextFeat->getKind() == "Parameter"; + aNextFeat = myObjs->nextFeature(aCurrent, anIndex)) + aCurrent = aNextFeat; + } } aDocToAdd->myObjs->addFeature(aFeature, aCurrent); if (!aFeature->isAction()) { // do not add action to the data model -- 2.39.2