Skip to content

Commit

Permalink
fix material binding of indexed lineset when highlighting an edge
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Apr 17, 2017
1 parent f44c200 commit b2c2e3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/Mod/Part/Gui/ViewProviderExt.cpp
Expand Up @@ -709,7 +709,8 @@ void ViewProviderPartExt::setHighlightedEdges(const std::vector<App::Color>& col
{
int size = static_cast<int>(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);
Expand All @@ -735,6 +736,7 @@ void ViewProviderPartExt::setHighlightedEdges(const std::vector<App::Color>& col

void ViewProviderPartExt::unsetHighlightedEdges()
{
pcLineBind->value = SoMaterialBinding::OVERALL;
LineMaterial.touch();
}

Expand Down
5 changes: 1 addition & 4 deletions src/Mod/Surface/Gui/SurfaceFilling.cpp
Expand Up @@ -153,10 +153,7 @@ void ViewProviderGeomFillSurface::highlightReferences(bool on)
svp->setHighlightedEdges(colors);
}
else {
std::vector<App::Color> colors;
colors.push_back(svp->LineColor.getValue());
svp->setHighlightedEdges(colors);
//svp->unsetHighlightedEdges();
svp->unsetHighlightedEdges();
}
}
}
Expand Down

0 comments on commit b2c2e3f

Please sign in to comment.