From a96eaf542639b3496724b0f308f672f7861a0f10 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 22 Jun 2022 10:58:41 +0200 Subject: [PATCH] Fix crash when pressing Ctrl+A while a gizmo is open (#8416): There were two separate issues. Missing update when select_all was invoked in the scene and missing check when SLA supports/hollow gizmo were asked to select all points/holes. --- src/slic3r/GUI/GLCanvas3D.cpp | 4 ++++ src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp | 2 +- src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 4b46df0a4..b1410c188 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1576,6 +1576,10 @@ void GLCanvas3D::select_all() { m_selection.add_all(); m_dirty = true; + wxGetApp().obj_manipul()->set_dirty(); + m_gizmos.reset_all_states(); + m_gizmos.update_data(); + post_event(SimpleEvent(EVT_GLCANVAS_OBJECT_SELECT)); } void GLCanvas3D::deselect_all() diff --git a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp index 7c985b237..9f423ac50 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp @@ -847,7 +847,7 @@ void GLGizmoHollow::select_point(int i) m_selected.assign(m_selected.size(), i == AllPoints); m_selection_empty = (i == NoPoints); - if (i == AllPoints) { + if (i == AllPoints && ! drain_holes.empty()) { m_new_hole_radius = drain_holes[0].radius; m_new_hole_height = drain_holes[0].height; } diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp index e3044dfc7..eb2dc3eeb 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp @@ -998,7 +998,7 @@ void GLGizmoSlaSupports::select_point(int i) point_and_selection.selected = ( i == AllPoints ); m_selection_empty = (i == NoPoints); - if (i == AllPoints) + if (i == AllPoints && ! m_editing_cache.empty()) m_new_point_head_diameter = m_editing_cache[0].support_point.head_front_radius * 2.f; } else {