From 2c7633dce57b925639183c8a21d7550d35f0a114 Mon Sep 17 00:00:00 2001 From: Fredia Huya-Kouadio Date: Sun, 19 Mar 2023 11:36:54 -0700 Subject: [PATCH] Fix the issue preventing dragging in the 2D and visual shader editor --- scene/gui/view_panner.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scene/gui/view_panner.cpp b/scene/gui/view_panner.cpp index 51af8867091..6d1905f1115 100644 --- a/scene/gui/view_panner.cpp +++ b/scene/gui/view_panner.cpp @@ -130,7 +130,12 @@ bool ViewPanner::gui_input(const Ref &p_event, Rect2 p_canvas_rect) Ref screen_drag = p_event; if (screen_drag.is_valid()) { - callback_helper(pan_callback, varray(screen_drag->get_relative(), p_event)); + if (Input::get_singleton()->is_emulating_mouse_from_touch() || Input::get_singleton()->is_emulating_touch_from_mouse()) { + // This set of events also generates/is generated by + // InputEventMouseButton/InputEventMouseMotion events which will be processed instead. + } else { + callback_helper(pan_callback, varray(screen_drag->get_relative(), p_event)); + } } Ref k = p_event;