Skip to content

[rcore][Emscripten] Convert emscripten wheel scroll to glfw units - #6417

Merged
raysan5 merged 1 commit into
raysan5:masterfrom
andzdroid:emscripten-mouse-wheel-scaling
Nov 16, 2026
Merged

raysan5 merged 1 commit into
raysan5:masterfrom
andzdroid:emscripten-mouse-wheel-scaling

Conversation

@andzdroid

Copy link
Copy Markdown
Contributor

No description provided.

@andzdroid andzdroid changed the title Convert emscripten wheel scroll to glfw units [rcore][Emscripten] Convert emscripten wheel scroll to glfw units Nov 15, 2026
@raysan5 raysan5 added the platform: Web Web platform (Wasm) label Nov 16, 2026
@raysan5
raysan5 merged commit bcb8581 into raysan5:master Nov 16, 2026
16 checks passed
@raysan5

raysan5 commented Nov 16, 2026

Copy link
Copy Markdown
Owner

@andzdroid thanks for the review... out of curiosity, why is this conversion required and why those magic numbers?

@andzdroid

Copy link
Copy Markdown
Contributor Author

rcore_web does the same conversion through emscripten's glfw layer: https://github.com/emscripten-core/emscripten/blob/main/src/lib/libglfw.js#L601

I copied the numbers from emscripten: https://github.com/emscripten-core/emscripten/blob/main/src/lib/libbrowser.js#L316

Now this backend does the same conversion that is done in rcore_web, and the units work better for glfw (so scrolling should roughly work the same as the desktop platform).

For why these numbers specifically, this is the explanation from emscripten (essentially no real reason, these values just feel right): emscripten-core/emscripten#7968

@andzdroid
andzdroid deleted the emscripten-mouse-wheel-scaling branch November 16, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: Web Web platform (Wasm)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants