Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web: Remove some unnecessary compatibility code #3766

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

daxpedda
Copy link
Member

Apparently MouseEvent.movementX/Y should not be used anymore.
Replacing it with screenX/Y simplifies the code, removes unnecessary conversion and increases accuracy.

Addresses #2875.

@daxpedda daxpedda added this to the Version 0.30.4 milestone Jun 28, 2024
Copy link
Member

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a reason why we didn't use screen[X|Y] before?

src/platform_impl/web/event_loop/runner.rs Outdated Show resolved Hide resolved
src/platform_impl/web/event_loop/runner.rs Show resolved Hide resolved
@daxpedda daxpedda force-pushed the web-movement-screen branch from 91aac75 to bbf16bc Compare June 28, 2024 22:45
@daxpedda
Copy link
Member Author

Was there a reason why we didn't use screen[X|Y] before?

movementX/Y is what we actually want here, but apparently the spec says:
https://w3c.github.io/pointerlock/#dom-mouseevent-movementx

movementX and movementY must be zero for all mouse events except mousemove.

We moved from mouse to pointer events (mousemove -> pointermove), so that doesn't really work out for us.
It worked until now because all browsers just don't follow the spec.

@daxpedda daxpedda merged commit 2e93e48 into rust-windowing:master Jun 28, 2024
51 of 53 checks passed
@daxpedda daxpedda removed this from the Version 0.30.4 milestone Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants