From 2080077c9cde09c0324234d5abe8fc2654547e51 Mon Sep 17 00:00:00 2001 From: "C.Even" Date: Sun, 27 Mar 2022 18:46:51 +0800 Subject: [PATCH] Fix that slow mouse wheel scroll has no zoom effect on 2D editor * scroll_vec in ViewPanner::gui_input is multiplied by float factors, so it should be a Vector2 rather than Vector2i * Fixes #57423 --- scene/gui/view_panner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/view_panner.cpp b/scene/gui/view_panner.cpp index 71865b4864b..892d0aba29e 100644 --- a/scene/gui/view_panner.cpp +++ b/scene/gui/view_panner.cpp @@ -37,7 +37,7 @@ bool ViewPanner::gui_input(const Ref &p_event, Rect2 p_canvas_rect) { Ref mb = p_event; if (mb.is_valid()) { - Vector2i scroll_vec = Vector2((mb->get_button_index() == MouseButton::WHEEL_RIGHT) - (mb->get_button_index() == MouseButton::WHEEL_LEFT), (mb->get_button_index() == MouseButton::WHEEL_DOWN) - (mb->get_button_index() == MouseButton::WHEEL_UP)); + Vector2 scroll_vec = Vector2((mb->get_button_index() == MouseButton::WHEEL_RIGHT) - (mb->get_button_index() == MouseButton::WHEEL_LEFT), (mb->get_button_index() == MouseButton::WHEEL_DOWN) - (mb->get_button_index() == MouseButton::WHEEL_UP)); if (scroll_vec != Vector2()) { if (control_scheme == SCROLL_PANS) { if (mb->is_ctrl_pressed()) {