From ed3134088be869a9e0c8bd3a7a6cfd672b532809 Mon Sep 17 00:00:00 2001 From: Andreas Haas Date: Fri, 24 Mar 2017 21:55:58 +0100 Subject: [PATCH] Input: Update mouse position on mouse-button events. (cherry picked from commit 468719c480100a0d5c8e5c5760f7f38f6a857d4a) --- main/input_default.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main/input_default.cpp b/main/input_default.cpp index 5e87025c0b1..1c4b8f8e56c 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -304,6 +304,11 @@ void InputDefault::parse_input_event(const InputEvent &p_event) { ev.screen_touch = touch_event; main_loop->input_event(ev); } + + Point2 pos = Point2(p_event.mouse_button.global_x, p_event.mouse_button.global_y); + if (mouse_pos != pos) { + set_mouse_pos(pos); + } } break; case InputEvent::MOUSE_MOTION: {