Web: fix MouseMotion coordinate space#3770
Merged
daxpedda merged 1 commit intorust-windowing:masterfrom Jul 5, 2024
Merged
Conversation
785d4e7 to
5787de1
Compare
kchibisov
approved these changes
Jul 5, 2024
5787de1 to
f64404b
Compare
f64404b to
0a6aa16
Compare
daxpedda
added a commit
that referenced
this pull request
Jul 16, 2024
kchibisov
pushed a commit
that referenced
this pull request
Jul 16, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/Ydoesn'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/Yreports and probably not what we want.Seeing that its unclear in the spec how browsers should implement
movementX/YI also opened w3c/pointerlock#100.Now that we don't have a choice but use
movementX/Ywe have to account for the following:pointermoveshould setmovementX/Yw3c/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.