mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Merge pull request #13382 from eska014/html5-fix-mousemotion-relative
Fix inverted relative mouse motion in HTML5 export
This commit is contained in:
commit
6a83c8e8ed
@ -201,7 +201,7 @@ static EM_BOOL _mousemove_callback(int event_type, const EmscriptenMouseEvent *m
|
|||||||
ev->set_position(pos);
|
ev->set_position(pos);
|
||||||
ev->set_global_position(ev->get_position());
|
ev->set_global_position(ev->get_position());
|
||||||
|
|
||||||
ev->set_relative(_input->get_mouse_position() - ev->get_position());
|
ev->set_relative(ev->get_position() - _input->get_mouse_position());
|
||||||
_input->set_mouse_position(ev->get_position());
|
_input->set_mouse_position(ev->get_position());
|
||||||
ev->set_speed(_input->get_last_mouse_speed());
|
ev->set_speed(_input->get_last_mouse_speed());
|
||||||
|
|
||||||
@ -336,7 +336,7 @@ static EM_BOOL _touchmove_callback(int event_type, const EmscriptenTouchEvent *t
|
|||||||
ev_mouse->set_position(Point2(first_touch.canvasX, first_touch.canvasY));
|
ev_mouse->set_position(Point2(first_touch.canvasX, first_touch.canvasY));
|
||||||
ev_mouse->set_global_position(ev_mouse->get_position());
|
ev_mouse->set_global_position(ev_mouse->get_position());
|
||||||
|
|
||||||
ev_mouse->set_relative(_input->get_mouse_position() - ev_mouse->get_position());
|
ev_mouse->set_relative(ev_mouse->get_position() - _input->get_mouse_position());
|
||||||
_input->set_mouse_position(ev_mouse->get_position());
|
_input->set_mouse_position(ev_mouse->get_position());
|
||||||
ev_mouse->set_speed(_input->get_last_mouse_speed());
|
ev_mouse->set_speed(_input->get_last_mouse_speed());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user