From b2c2e3ffdab35b69159a01919148580a6689f7c9 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 17 Apr 2017 19:02:11 +0200 Subject: [PATCH] fix material binding of indexed lineset when highlighting an edge --- src/Mod/Part/Gui/ViewProviderExt.cpp | 4 +++- src/Mod/Surface/Gui/SurfaceFilling.cpp | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Mod/Part/Gui/ViewProviderExt.cpp b/src/Mod/Part/Gui/ViewProviderExt.cpp index b7c814427e02..8c832cf9690c 100644 --- a/src/Mod/Part/Gui/ViewProviderExt.cpp +++ b/src/Mod/Part/Gui/ViewProviderExt.cpp @@ -709,7 +709,8 @@ void ViewProviderPartExt::setHighlightedEdges(const std::vector& col { int size = static_cast(colors.size()); if (size > 1) { - pcLineBind->value = SoMaterialBinding::PER_PART; + // Although indexed lineset is used the material binding must be PER_FACE! + pcLineBind->value = SoMaterialBinding::PER_FACE; const int32_t* cindices = this->lineset->coordIndex.getValues(0); int numindices = this->lineset->coordIndex.getNum(); pcLineMaterial->diffuseColor.setNum(size); @@ -735,6 +736,7 @@ void ViewProviderPartExt::setHighlightedEdges(const std::vector& col void ViewProviderPartExt::unsetHighlightedEdges() { + pcLineBind->value = SoMaterialBinding::OVERALL; LineMaterial.touch(); } diff --git a/src/Mod/Surface/Gui/SurfaceFilling.cpp b/src/Mod/Surface/Gui/SurfaceFilling.cpp index faf34680bf41..11db01538952 100644 --- a/src/Mod/Surface/Gui/SurfaceFilling.cpp +++ b/src/Mod/Surface/Gui/SurfaceFilling.cpp @@ -153,10 +153,7 @@ void ViewProviderGeomFillSurface::highlightReferences(bool on) svp->setHighlightedEdges(colors); } else { - std::vector colors; - colors.push_back(svp->LineColor.getValue()); - svp->setHighlightedEdges(colors); - //svp->unsetHighlightedEdges(); + svp->unsetHighlightedEdges(); } } }