diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-05-10 01:26:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-10 01:26:49 +0200 |
commit | fe82b5a1220a1948c03c92544a7e066cb0cd9057 (patch) | |
tree | b41634d123ede8286b478dd7193bf6db2d2db5ba /platform | |
parent | 919d802e6665be1c2e984b26098a8a2a707d5ec1 (diff) | |
parent | d78b10313b78e56a65ef4fdfeef6d85ae8ad5311 (diff) |
Merge pull request #18749 from eska014/html5-mousecapture-rel
Fix relative motion with captured mouse in HTML5 platform
Diffstat (limited to 'platform')
-rw-r--r-- | platform/javascript/os_javascript.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 1b5463e40d..a55609df58 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -204,7 +204,7 @@ static EM_BOOL _mousemove_callback(int event_type, const EmscriptenMouseEvent *m ev->set_position(pos); ev->set_global_position(ev->get_position()); - ev->set_relative(ev->get_position() - _input->get_mouse_position()); + ev->set_relative(Vector2(mouse_event->movementX, mouse_event->movementY)); _input->set_mouse_position(ev->get_position()); ev->set_speed(_input->get_last_mouse_speed()); |