diff --git a/src/Mod/Part/Gui/ViewProviderBoolean.cpp b/src/Mod/Part/Gui/ViewProviderBoolean.cpp index d888e71043..23d98670be 100644 --- a/src/Mod/Part/Gui/ViewProviderBoolean.cpp +++ b/src/Mod/Part/Gui/ViewProviderBoolean.cpp @@ -110,27 +110,23 @@ void ViewProviderBoolean::updateData(const App::Property* prop) applyTransparency(static_cast(vpBase)->Transparency.getValue(),colBase); applyTransparency(static_cast(vpTool)->Transparency.getValue(),colTool); - bool setColor=false; if (static_cast(colBase.size()) == baseMap.Extent()) { applyColor(hist[0], colBase, colBool); - setColor = true; } else if (!colBase.empty() && colBase[0] != this->ShapeColor.getValue()) { colBase.resize(baseMap.Extent(), colBase[0]); applyColor(hist[0], colBase, colBool); - setColor = true; } + if (static_cast(colTool.size()) == toolMap.Extent()) { applyColor(hist[1], colTool, colBool); - setColor = true; } else if (!colTool.empty() && colTool[0] != this->ShapeColor.getValue()) { colTool.resize(toolMap.Extent(), colTool[0]); applyColor(hist[1], colTool, colBool); - setColor = true; } - if (setColor) - this->DiffuseColor.setValues(colBool); + + this->DiffuseColor.setValues(colBool); } } } @@ -194,7 +190,6 @@ void ViewProviderMultiFuse::updateData(const App::Property* prop) std::vector colBool; colBool.resize(boolMap.Extent(), this->ShapeColor.getValue()); - bool setColor=false; int index=0; for (std::vector::iterator it = sources.begin(); it != sources.end(); ++it, ++index) { Part::Feature* objBase = dynamic_cast(*it); @@ -211,18 +206,15 @@ void ViewProviderMultiFuse::updateData(const App::Property* prop) applyTransparency(static_cast(vpBase)->Transparency.getValue(),colBase); if (static_cast(colBase.size()) == baseMap.Extent()) { applyColor(hist[index], colBase, colBool); - setColor = true; } else if (!colBase.empty() && colBase[0] != this->ShapeColor.getValue()) { colBase.resize(baseMap.Extent(), colBase[0]); applyColor(hist[index], colBase, colBool); - setColor = true; } } } - if (setColor) - this->DiffuseColor.setValues(colBool); + this->DiffuseColor.setValues(colBool); } else if (prop->getTypeId() == App::PropertyLinkList::getClassTypeId()) { std::vector pShapes = static_cast(prop)->getValues(); @@ -326,7 +318,6 @@ void ViewProviderMultiCommon::updateData(const App::Property* prop) std::vector colBool; colBool.resize(boolMap.Extent(), this->ShapeColor.getValue()); - bool setColor=false; int index=0; for (std::vector::iterator it = sources.begin(); it != sources.end(); ++it, ++index) { Part::Feature* objBase = dynamic_cast(*it); @@ -343,18 +334,15 @@ void ViewProviderMultiCommon::updateData(const App::Property* prop) applyTransparency(static_cast(vpBase)->Transparency.getValue(),colBase); if (static_cast(colBase.size()) == baseMap.Extent()) { applyColor(hist[index], colBase, colBool); - setColor = true; } else if (!colBase.empty() && colBase[0] != this->ShapeColor.getValue()) { colBase.resize(baseMap.Extent(), colBase[0]); applyColor(hist[index], colBase, colBool); - setColor = true; } } } - if (setColor) - this->DiffuseColor.setValues(colBool); + this->DiffuseColor.setValues(colBool); } else if (prop->getTypeId() == App::PropertyLinkList::getClassTypeId()) { std::vector pShapes = static_cast(prop)->getValues(); diff --git a/src/Mod/Part/Gui/ViewProviderCompound.cpp b/src/Mod/Part/Gui/ViewProviderCompound.cpp index 19512c9746..609fa23608 100644 --- a/src/Mod/Part/Gui/ViewProviderCompound.cpp +++ b/src/Mod/Part/Gui/ViewProviderCompound.cpp @@ -81,7 +81,6 @@ void ViewProviderCompound::updateData(const App::Property* prop) std::vector compCol; compCol.resize(compMap.Extent(), this->ShapeColor.getValue()); - bool setColor=false; int index=0; for (std::vector::iterator it = sources.begin(); it != sources.end(); ++it, ++index) { Part::Feature* objBase = dynamic_cast(*it); @@ -98,17 +97,14 @@ void ViewProviderCompound::updateData(const App::Property* prop) applyTransparency(static_cast(vpBase)->Transparency.getValue(),baseCol); if (static_cast(baseCol.size()) == baseMap.Extent()) { applyColor(hist[index], baseCol, compCol); - setColor = true; } else if (!baseCol.empty() && baseCol[0] != this->ShapeColor.getValue()) { baseCol.resize(baseMap.Extent(), baseCol[0]); applyColor(hist[index], baseCol, compCol); - setColor = true; } } - if (setColor) - this->DiffuseColor.setValues(compCol); + this->DiffuseColor.setValues(compCol); } else if (prop->getTypeId() == App::PropertyLinkList::getClassTypeId()) { const std::vector& pBases = static_cast(prop)->getValues();