Skip to content

fix: normalize Emscripten wheel events by deltaMode#164

Closed
monofuel wants to merge 1 commit intotreeform:masterfrom
monofuel:fix/emscripten-scroll-normalization
Closed

fix: normalize Emscripten wheel events by deltaMode#164
monofuel wants to merge 1 commit intotreeform:masterfrom
monofuel:fix/emscripten-scroll-normalization

Conversation

@monofuel
Copy link
Collaborator

Raw WheelEvent.deltaX/Y values are not comparable across OS/browser combinations. Linux browsers (Chrome/Firefox) typically report ~120px per notch in DOM_DELTA_PIXEL mode, while macOS trackpads send small continuous values, making scroll feel ~10x too fast on Linux web builds.

Normalize each deltaMode to target ~10 units per notch, matching the native Linux X11 backend (fixed ±10) and macOS backend (scrollingDeltaX/Y * 0.1 * 10 getter).

Raw WheelEvent.deltaX/Y values are not comparable across OS/browser
combinations. Linux browsers (Chrome/Firefox) typically report
~120px per notch in DOM_DELTA_PIXEL mode, while macOS trackpads
send small continuous values, making scroll feel ~10x too fast on
Linux web builds.

Normalize each deltaMode to target ~10 units per notch, matching
the native Linux X11 backend (fixed ±10) and macOS backend
(scrollingDeltaX/Y * 0.1 * 10 getter).

Also removes the leftover debug echo from the onWheel handler.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@monofuel monofuel marked this pull request as ready for review February 17, 2026 21:16
@monofuel
Copy link
Collaborator Author

nope all wrong! both platforms report delta mode 0

@monofuel monofuel closed this Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments