From 2f4f39c7b3ae934eacf485284f2a80ff3b41ff83 Mon Sep 17 00:00:00 2001 From: Adam Scott Date: Tue, 17 Sep 2024 12:37:45 -0400 Subject: [PATCH] Fix trackpad code completion scrolling --- scene/gui/code_edit.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp index c3287035ffc..dff1cf34c2f 100644 --- a/scene/gui/code_edit.cpp +++ b/scene/gui/code_edit.cpp @@ -277,15 +277,17 @@ void CodeEdit::gui_input(const Ref &p_gui_input) { code_completion_force_item_center = -1; queue_redraw(); } - code_completion_pan_offset += 1.0f; + code_completion_pan_offset = 0; } else if (code_completion_pan_offset >= +1.0) { if (code_completion_current_selected < code_completion_options.size() - 1) { code_completion_current_selected++; code_completion_force_item_center = -1; queue_redraw(); } - code_completion_pan_offset -= 1.0f; + code_completion_pan_offset = 0; } + accept_event(); + return; } Ref mb = p_gui_input;