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,7 +1562,10 @@ void ViewProviderMesh::setSelection(const std::vector<unsigned long>& indices)
rMesh.addFacetsToSelection(indices);
// Colorize the selection
highlightSelection();
if (indices.empty())
unhighlightSelection();
else
highlightSelection();
}
void ViewProviderMesh::addSelection(const std::vector<unsigned long>& indices)
@ -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,7 +160,12 @@ void ViewProviderMeshFaceSet::updateData(const App::Property* prop)
}
showOpenEdges(OpenEdges.getValue());
highlightSelection();
std::vector<unsigned long> selection;
mesh->getFacetsFromSelection(selection);
if (selection.empty())
unhighlightSelection();
else
highlightSelection();
}
}