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,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

View File

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

View File

@ -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;
}