diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index 9fba82fe0a..7ccc70c951 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -709,12 +709,7 @@ void finishFeature(const Gui::Command* cmd, const std::string& FeatName, if (updateDocument) cmd->updateActive(); - // #0001721: use '0' as edit value to avoid switching off selection in - // ViewProviderGeometryObject::setEditViewer - cmd->doCommand(cmd->Gui,"Gui.activeDocument().setEdit('%s', 0)", FeatName.c_str()); - cmd->doCommand(cmd->Gui,"Gui.Selection.clearSelection()"); - //cmd->doCommand(cmd->Gui,"Gui.Selection.addSelection(App.ActiveDocument.ActiveObject)"); - + // Do this before calling setEdit to avoid to override the 'Shape preview' mode (#0003621) if (pcActiveBody) { cmd->copyVisual(FeatName.c_str(), "ShapeColor", pcActiveBody->getNameInDocument()); cmd->copyVisual(FeatName.c_str(), "LineColor", pcActiveBody->getNameInDocument()); @@ -722,6 +717,12 @@ void finishFeature(const Gui::Command* cmd, const std::string& FeatName, cmd->copyVisual(FeatName.c_str(), "Transparency", pcActiveBody->getNameInDocument()); cmd->copyVisual(FeatName.c_str(), "DisplayMode", pcActiveBody->getNameInDocument()); } + + // #0001721: use '0' as edit value to avoid switching off selection in + // ViewProviderGeometryObject::setEditViewer + cmd->doCommand(cmd->Gui,"Gui.activeDocument().setEdit('%s', 0)", FeatName.c_str()); + cmd->doCommand(cmd->Gui,"Gui.Selection.clearSelection()"); + //cmd->doCommand(cmd->Gui,"Gui.Selection.addSelection(App.ActiveDocument.ActiveObject)"); } //===========================================================================