From 41b278a05bdf7500a2e16c341a7958a6761403b2 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 10 Jun 2018 10:12:32 +0200 Subject: [PATCH] fixes #0003256: additive elements do not use color of Body --- src/Mod/PartDesign/Gui/CommandBody.cpp | 2 +- src/Mod/PartDesign/Gui/CommandPrimitive.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Mod/PartDesign/Gui/CommandBody.cpp b/src/Mod/PartDesign/Gui/CommandBody.cpp index 0453bd227d..b1185a86b0 100644 --- a/src/Mod/PartDesign/Gui/CommandBody.cpp +++ b/src/Mod/PartDesign/Gui/CommandBody.cpp @@ -593,7 +593,7 @@ void CmdPartDesignMoveTip::activated(int iMsg) App::DocumentObject* oldTip = body->Tip.getValue(); if (oldTip == selFeature) { // it's not generally an error, so print only a console message - Base::Console().Message ("%s is already the tip of the body", selFeature->getNameInDocument () ); + Base::Console().Message ("%s is already the tip of the body\n", selFeature->getNameInDocument () ); return; } diff --git a/src/Mod/PartDesign/Gui/CommandPrimitive.cpp b/src/Mod/PartDesign/Gui/CommandPrimitive.cpp index 74d2b5fd14..2291c4dbf5 100644 --- a/src/Mod/PartDesign/Gui/CommandPrimitive.cpp +++ b/src/Mod/PartDesign/Gui/CommandPrimitive.cpp @@ -118,6 +118,14 @@ void CmdPrimtiveCompAdditive::activated(int iMsg) if (prm->BaseFeature.getValue()) doCommand(Gui,"Gui.activeDocument().hide(\"%s\")", prm->BaseFeature.getValue()->getNameInDocument()); + if (pcActiveBody) { + copyVisual(FeatName.c_str(), "ShapeColor", pcActiveBody->getNameInDocument()); + copyVisual(FeatName.c_str(), "LineColor", pcActiveBody->getNameInDocument()); + copyVisual(FeatName.c_str(), "PointColor", pcActiveBody->getNameInDocument()); + copyVisual(FeatName.c_str(), "Transparency", pcActiveBody->getNameInDocument()); + copyVisual(FeatName.c_str(), "DisplayMode", pcActiveBody->getNameInDocument()); + } + Gui::Command::doCommand(Gui, "Gui.activeDocument().setEdit(\'%s\')", FeatName.c_str()); } @@ -275,6 +283,14 @@ void CmdPrimtiveCompSubtractive::activated(int iMsg) } } + if (pcActiveBody) { + copyVisual(FeatName.c_str(), "ShapeColor", pcActiveBody->getNameInDocument()); + copyVisual(FeatName.c_str(), "LineColor", pcActiveBody->getNameInDocument()); + copyVisual(FeatName.c_str(), "PointColor", pcActiveBody->getNameInDocument()); + copyVisual(FeatName.c_str(), "Transparency", pcActiveBody->getNameInDocument()); + copyVisual(FeatName.c_str(), "DisplayMode", pcActiveBody->getNameInDocument()); + } + Gui::Command::doCommand(Gui, "Gui.activeDocument().setEdit(\'%s\')", FeatName.c_str()); }