summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorFredia Huya-Kouadio <fhuya@meta.com>2023-04-07 17:44:39 +0200
committerYuri Sizov <yuris@humnom.net>2023-04-07 17:44:39 +0200
commit589c32ec557edbe53c0ab7f0bf45058a7340b5ba (patch)
tree6c9e87af2ac0cb088c10b0a9837fccb86266cc80 /scene/gui
parent9598eb9638e9638d4d0e894d7c73429007149bd2 (diff)
Fix the issue preventing dragging in the 2D and visual shader editor
(cherry picked from commit 2c7633dce57b925639183c8a21d7550d35f0a114)
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/view_panner.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/scene/gui/view_panner.cpp b/scene/gui/view_panner.cpp
index 51af886709..6d1905f111 100644
--- a/scene/gui/view_panner.cpp
+++ b/scene/gui/view_panner.cpp
@@ -130,7 +130,12 @@ bool ViewPanner::gui_input(const Ref<InputEvent> &p_event, Rect2 p_canvas_rect)
Ref<InputEventScreenDrag> 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<InputEventKey> k = p_event;