FIX: height not synced when inputing cut movement

Change-Id: I0640f9a21e1d700806ade79e4e1637338aef963a
(cherry picked from commit 8bacb887da19a9bed6451d2aaa1ebc149c20359d)
This commit is contained in:
Arthur 2022-09-22 16:58:18 +08:00 committed by Lane.Wei
parent c47f892ec8
commit 92f1236128

View file

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