diff --git a/src/Mod/Mesh/Gui/ViewProvider.cpp b/src/Mod/Mesh/Gui/ViewProvider.cpp index d92766190..196857b06 100644 --- a/src/Mod/Mesh/Gui/ViewProvider.cpp +++ b/src/Mod/Mesh/Gui/ViewProvider.cpp @@ -1562,7 +1562,10 @@ void ViewProviderMesh::setSelection(const std::vector& indices) rMesh.addFacetsToSelection(indices); // Colorize the selection - highlightSelection(); + if (indices.empty()) + unhighlightSelection(); + else + highlightSelection(); } void ViewProviderMesh::addSelection(const std::vector& indices) @@ -1627,7 +1630,7 @@ void ViewProviderMesh::highlightSelection() const Mesh::MeshObject& rMesh = static_cast(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; } diff --git a/src/Mod/Mesh/Gui/ViewProviderMeshFaceSet.cpp b/src/Mod/Mesh/Gui/ViewProviderMeshFaceSet.cpp index 4c517cd46..a312e2ccc 100644 --- a/src/Mod/Mesh/Gui/ViewProviderMeshFaceSet.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderMeshFaceSet.cpp @@ -160,7 +160,12 @@ void ViewProviderMeshFaceSet::updateData(const App::Property* prop) } showOpenEdges(OpenEdges.getValue()); - highlightSelection(); + std::vector selection; + mesh->getFacetsFromSelection(selection); + if (selection.empty()) + unhighlightSelection(); + else + highlightSelection(); } }