Fix bug when painting selection in mesh view provider

This commit is contained in:
wmayer 2012-09-28 12:33:26 +02:00
parent 765d887943
commit bcddb1e950
2 changed files with 11 additions and 3 deletions

View File

@ -1562,6 +1562,9 @@ void ViewProviderMesh::setSelection(const std::vector<unsigned long>& indices)
rMesh.addFacetsToSelection(indices);
// Colorize the selection
if (indices.empty())
unhighlightSelection();
else
highlightSelection();
}
@ -1627,7 +1630,7 @@ void ViewProviderMesh::highlightSelection()
const Mesh::MeshObject& rMesh = static_cast<Mesh::Feature*>(pcObject)->Mesh.getValue();
rMesh.getFacetsFromSelection(selection);
if (selection.empty()) {
// If no faces are selected then simply return even without
// If no faces are selected then simply return even
// without calling unhighlightSelection()
return;
}

View File

@ -160,6 +160,11 @@ void ViewProviderMeshFaceSet::updateData(const App::Property* prop)
}
showOpenEdges(OpenEdges.getValue());
std::vector<unsigned long> selection;
mesh->getFacetsFromSelection(selection);
if (selection.empty())
unhighlightSelection();
else
highlightSelection();
}
}