From ec57a7f9711d6e8293c4e181046c9ff6c3e51e8b Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Thu, 9 May 2019 10:09:33 +0200 Subject: [PATCH] Fixed current gizmo not turning off when removing last object from selection by ctrl + click and using selection rectangle --- src/slic3r/GUI/GLCanvas3D.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index df8124efa..307b0af59 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2741,7 +2741,11 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) // propagate event through callback if (curr_idxs != m_selection.get_volume_idxs()) { - m_gizmos.refresh_on_off_state(m_selection); + if (m_selection.is_empty()) + m_gizmos.reset_all_states(); + else + m_gizmos.refresh_on_off_state(m_selection); + m_gizmos.update_data(*this); post_event(SimpleEvent(EVT_GLCANVAS_OBJECT_SELECT)); m_dirty = true; @@ -5719,7 +5723,11 @@ void GLCanvas3D::_update_selection_from_hover() m_selection.remove(i); } - m_gizmos.refresh_on_off_state(m_selection); + if (m_selection.is_empty()) + m_gizmos.reset_all_states(); + else + m_gizmos.refresh_on_off_state(m_selection); + m_gizmos.update_data(*this); post_event(SimpleEvent(EVT_GLCANVAS_OBJECT_SELECT)); m_dirty = true;