Web: fix MouseMotion
coordinate space
#3770
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This basically reverts #3766.
Reason being that
screenX/Y
doesn't work when locking the pointer. Its also not ideal because when you move the pointer out of the frame and enter it again, it pretends like the mouse moved a lot, which is quite different then whatmovementX/Y
reports and probably not what we want.Seeing that its unclear in the spec how browsers should implement
movementX/Y
I also opened w3c/pointerlock#100.Now that we don't have a choice but use
movementX/Y
we have to account for the following:pointermove
should setmovementX/Y
w3c/pointerlock#100 has been resolved and all browsers actually set values there instead of zero. Which they currently do.To account for all these issues, I added some browser engine detection code, which I might expose to the user in a follow-up PR.
Also have to update #2875 after this is merged.