Skip to content

Zoom improvements#570

Open
trumank wants to merge 2 commits intoasny:masterfrom
trumank:zoom-improvements
Open

Zoom improvements#570
trumank wants to merge 2 commits intoasny:masterfrom
trumank:zoom-improvements

Conversation

@trumank
Copy link

@trumank trumank commented Jan 29, 2026

This is a fix for #403

As far as I can tell, there isn't a better way of normalizing mouse wheel deltas across various platforms than coming up with some "good enough" magic values, so that's what I've done.

Currently, wasm builds running in Firefox/Chrome on both Windows and Linux have this zoom bug that results in zoom-in resulting in the camera zooming all the way in, and zoom out resulting in much larger steps than desktop. Mac OS + trackpad seems to work fine.

I've adjusted the scroll delta from PixelDelta events (from wasm) to be much closer to the LineDelta events (from desktop) and now zooming on web behaves much better across all the platforms I've mentioned.

I've also included patches to make zooming in and out symmetric (previously zoom in then out would not return to original zoom level).

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