diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 964cef175..63aa2e4c5 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -4076,16 +4076,8 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) m_mouse.position = pos.cast(); if (evt.Dragging() && current_printer_technology() == ptFFF && (fff_print()->config().print_sequence == PrintSequence::ByObject)) { - switch (m_gizmos.get_current_type()) - { - case GLGizmosManager::EType::Move: - case GLGizmosManager::EType::Scale: - case GLGizmosManager::EType::Rotate: - { + if (can_sequential_clearance_show_in_gizmo()) { update_sequential_clearance(); - break; - } - default: { break; } } } else if (evt.Dragging()) { @@ -5266,6 +5258,17 @@ void GLCanvas3D::mouse_up_cleanup() m_canvas->ReleaseMouse(); } +bool GLCanvas3D::can_sequential_clearance_show_in_gizmo() { + switch (m_gizmos.get_current_type()) { + case GLGizmosManager::EType::Move: + case GLGizmosManager::EType::Scale: + case GLGizmosManager::EType::Rotate: { + return true; + } + } + return false; +} + void GLCanvas3D::update_sequential_clearance() { if (current_printer_technology() != ptFFF || (fff_print()->config().print_sequence == PrintSequence::ByLayer)) @@ -7283,19 +7286,11 @@ void GLCanvas3D::_render_sequential_clearance() { if (m_gizmos.is_dragging()) return; - - switch (m_gizmos.get_current_type()) - { - case GLGizmosManager::EType::Flatten: - case GLGizmosManager::EType::Cut: - case GLGizmosManager::EType::Hollow: - case GLGizmosManager::EType::SlaSupports: - case GLGizmosManager::EType::FdmSupports: - case GLGizmosManager::EType::Seam: { return; } - default: { break; } + auto type = m_gizmos.get_current_type(); + if (type == GLGizmosManager::EType::Undefined + || can_sequential_clearance_show_in_gizmo()) { + m_sequential_print_clearance.render(); } - - m_sequential_print_clearance.render(); } #if ENABLE_RENDER_SELECTION_CENTER diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index 4408016a8..2b0095998 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -1073,6 +1073,7 @@ public: m_sequential_print_clearance.set_polygons(polygons, height_polygons); } + bool can_sequential_clearance_show_in_gizmo(); void update_sequential_clearance(); const Print* fff_print() const;