diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-10-27 09:47:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-27 09:47:12 +0100 |
commit | 4f0c05402f94e6055463c86bcdbb06b2b72b3d7d (patch) | |
tree | 14ec5fbb458327dad2acc36b617cfae889ada0b3 /platform/windows | |
parent | ad685960da2473cb361edca720120e9d01be5e08 (diff) | |
parent | d66dcc86f9aea71aa852b293a702111cae72803d (diff) |
Merge pull request #33096 from jcs224/windows-screendrag-relative
Allow use of relative and speed properties for InputEventScreenDrag on Windows
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/os_windows.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 81b8d08b3d..6544314825 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -288,15 +288,16 @@ void OS_Windows::_drag_event(float p_x, float p_y, int idx) { if (curr->get() == Vector2(p_x, p_y)) return; - curr->get() = Vector2(p_x, p_y); - Ref<InputEventScreenDrag> event; event.instance(); event->set_index(idx); event->set_position(Vector2(p_x, p_y)); + event->set_relative(Vector2(p_x, p_y) - curr->get()); if (main_loop) input->accumulate_input_event(event); + + curr->get() = Vector2(p_x, p_y); }; LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { |