From 1218103fd620b319c56fd08116f81b581c537188 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Mon, 30 Jan 2023 09:34:17 +0100 Subject: [PATCH] Revert of a3324d3e50114aa16c48be7ec6b939c9315f4dde - Replaced with a more robust fix --- src/slic3r/GUI/GLCanvas3D.cpp | 7 +------ src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp | 8 +++++--- src/slic3r/GUI/Gizmos/GLGizmosManager.cpp | 7 ++++++- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 0adfdb92e..a50452c7c 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2004,12 +2004,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re else m_selection.volumes_changed(map_glvolume_old_to_new); - // The current gizmo may be not supported by the current printer technology - // after the user changes printer. - // Check if it is still activable before to call update_data() method. - const GLGizmoBase* gizmo = m_gizmos.get_current(); - if (gizmo != nullptr && gizmo->is_activable()) - m_gizmos.update_data(); + m_gizmos.update_data(); m_gizmos.refresh_on_off_state(); // Update the toolbar diff --git a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp index 2b73c0e62..7add6075b 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp @@ -55,9 +55,11 @@ void GLGizmoHollow::data_changed() } const SLAPrintObject* po = m_c->selection_info()->print_object(); - std::shared_ptr preview_mesh_ptr = po->get_mesh_to_print(); - if (po != nullptr && (!preview_mesh_ptr || preview_mesh_ptr->empty())) - reslice_until_step(slaposAssembly); + if (po != nullptr) { + std::shared_ptr preview_mesh_ptr = po->get_mesh_to_print(); + if (!preview_mesh_ptr || preview_mesh_ptr->empty()) + reslice_until_step(slaposAssembly); + } update_volumes(); diff --git a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp index 001074a2c..d369c9505 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp @@ -170,7 +170,12 @@ void GLGizmosManager::reset_all_states() if (! m_enabled || m_serializing) return; - activate_gizmo(Undefined); + EType current = get_current_type(); + if (current != Undefined) + // close any open gizmo + open_gizmo(current); + else + activate_gizmo(Undefined); m_hover = Undefined; }