From ea494833342b76d04562c12c7bdbe9dfda95d2bc Mon Sep 17 00:00:00 2001 From: FifthTundraG <117035030+FifthTundraG@users.noreply.github.com> Date: Sun, 28 Dec 2025 13:46:40 -0500 Subject: [PATCH] Fix `ScrollBar` not accepting `InputEventPanGesture` --- scene/gui/scroll_bar.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index d070d2d163..90bbd3180c 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -46,6 +46,37 @@ void ScrollBar::gui_input(const Ref &p_event) { Ref b = p_event; + Ref pg = p_event; + + if (pg.is_valid()) { + accept_event(); + + if (orientation == HORIZONTAL) { + if (pg->get_delta().x != 0) { + if (pg->get_delta().x < 0) { + scroll(-MAX(fabsf(pg->get_delta().x), get_step())); + } + if (pg->get_delta().x > 0) { + scroll(MAX(pg->get_delta().x, get_step())); + } + } else if (pg->get_delta().y != 0) { + if (pg->get_delta().y < 0) { + scroll(-MAX(fabsf(pg->get_delta().y), get_step())); + } + if (pg->get_delta().y > 0) { + scroll(MAX(pg->get_delta().y, get_step())); + } + } + } else { + if (pg->get_delta().y < 0) { + scroll(-MAX(fabsf(pg->get_delta().y), get_step())); + } + if (pg->get_delta().y > 0) { + scroll(MAX(pg->get_delta().y, get_step())); + } + } + } + if (b.is_valid()) { accept_event();