From 92f1236128f225428c22e16d2d1c7e7356ebc2e0 Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 22 Sep 2022 16:58:18 +0800 Subject: [PATCH] FIX: height not synced when inputing cut movement Change-Id: I0640f9a21e1d700806ade79e4e1637338aef963a (cherry picked from commit 8bacb887da19a9bed6451d2aaa1ebc149c20359d) --- src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp b/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp index 1f5c46a7c..7e41be0dd 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp @@ -479,6 +479,13 @@ void GLGizmoAdvancedCut::on_render_input_window(float x, float y, float bottom_l if (std::abs(m_buffered_movement - m_movement) > EPSILON) { m_movement = m_buffered_movement; m_buffered_movement = 0.0; + + // update absolute height + Vec3d plane_normal = get_plane_normal(); + m_height_delta = plane_normal(2) * m_movement; + m_height += m_height_delta; + m_buffered_height = m_height; + update_plane_points(); m_parent.post_event(SimpleEvent(wxEVT_PAINT)); } @@ -497,8 +504,7 @@ void GLGizmoAdvancedCut::on_render_input_window(float x, float y, float bottom_l if (current_active_id != m_last_active_id) { if (std::abs(m_buffered_height - m_height) > EPSILON) { m_height_delta = m_buffered_height - m_height; - m_height = m_buffered_height; - //m_buffered_height = 0.0; + m_height = m_buffered_height; update_plane_points(); m_parent.post_event(SimpleEvent(wxEVT_PAINT)); }