diff options
author | Zae <zaevi@live.com> | 2022-09-29 01:47:03 +0800 |
---|---|---|
committer | Zae <zaevi@live.com> | 2022-09-29 01:47:03 +0800 |
commit | 186ca020b3174f1a4c550abee141a42afe61fafb (patch) | |
tree | 425cd2e0818c12d809596ef73ffd990ed0c0e561 | |
parent | 14e1f36e614686f3fea0c74fac3624d1027dd5cc (diff) |
Fix ScrollContainer touch-scrolling not working.
-rw-r--r-- | platform/windows/display_server_windows.cpp | 2 | ||||
-rw-r--r-- | scene/gui/scroll_container.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 77b20dd924..9e958be26f 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -565,7 +565,7 @@ bool DisplayServerWindows::screen_is_touchscreen(int p_screen) const { #ifndef _MSC_VER #warning touchscreen not working #endif - return false; + return DisplayServer::screen_is_touchscreen(p_screen); } void DisplayServerWindows::screen_set_orientation(ScreenOrientation p_orientation, int p_screen) { diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index 761072c5bc..a6aa4707ff 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -162,7 +162,7 @@ void ScrollContainer::gui_input(const Ref<InputEvent> &p_gui_input) { drag_accum = Vector2(); last_drag_accum = Vector2(); drag_from = Vector2(h_scroll->get_value(), v_scroll->get_value()); - drag_touching = !DisplayServer::get_singleton()->screen_is_touchscreen(DisplayServer::get_singleton()->window_get_current_screen(get_viewport()->get_window_id())); + drag_touching = DisplayServer::get_singleton()->screen_is_touchscreen(DisplayServer::get_singleton()->window_get_current_screen(get_viewport()->get_window_id())); drag_touching_deaccel = false; beyond_deadzone = false; time_since_motion = 0; |