Merge pull request #18749 from eska014/html5-mousecapture-rel

Fix relative motion with captured mouse in HTML5 platform
This commit is contained in:
Rémi Verschelde 2018-05-10 01:26:49 +02:00 committed by GitHub
commit fe82b5a122
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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());