Revert of a3324d3e50 - Replaced with a more robust fix

This commit is contained in:
enricoturri1966 2023-01-30 09:34:17 +01:00
parent 66a4b5b82a
commit 1218103fd6
3 changed files with 12 additions and 10 deletions

View File

@ -2004,11 +2004,6 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
else else
m_selection.volumes_changed(map_glvolume_old_to_new); 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(); m_gizmos.refresh_on_off_state();

View File

@ -55,9 +55,11 @@ void GLGizmoHollow::data_changed()
} }
const SLAPrintObject* po = m_c->selection_info()->print_object(); const SLAPrintObject* po = m_c->selection_info()->print_object();
if (po != nullptr) {
std::shared_ptr<const indexed_triangle_set> preview_mesh_ptr = po->get_mesh_to_print(); std::shared_ptr<const indexed_triangle_set> preview_mesh_ptr = po->get_mesh_to_print();
if (po != nullptr && (!preview_mesh_ptr || preview_mesh_ptr->empty())) if (!preview_mesh_ptr || preview_mesh_ptr->empty())
reslice_until_step(slaposAssembly); reslice_until_step(slaposAssembly);
}
update_volumes(); update_volumes();

View File

@ -170,6 +170,11 @@ void GLGizmosManager::reset_all_states()
if (! m_enabled || m_serializing) if (! m_enabled || m_serializing)
return; return;
EType current = get_current_type();
if (current != Undefined)
// close any open gizmo
open_gizmo(current);
else
activate_gizmo(Undefined); activate_gizmo(Undefined);
m_hover = Undefined; m_hover = Undefined;
} }