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

Inconsistant mouse wheel zoom step on Firefox #10621

Open
Nekzuris opened this issue Dec 21, 2024 · 1 comment · May be fixed by #10627
Open

Inconsistant mouse wheel zoom step on Firefox #10621

Nekzuris opened this issue Dec 21, 2024 · 1 comment · May be fixed by #10627

Comments

@Nekzuris
Copy link
Contributor

URL

https://ideditor.netlify.app/#background=fr.ign.bdortho&disable_features=boundaries&map=19.00/48.03756/7.01676

How to reproduce the issue?

Zoom out with the mouse wheel and observe the zoom value in URL (on https://ideditor.netlify.app or https://www.openstreetmap.org/id, because https://www.openstreetmap.org/edit doesn't show fractional zoom levels #10091).

Sometimes the step is 0.20 sometimes 0.21, on Chrome it's always 0.20.

Screenshot(s) or anything else?

No response

Which deployed environments do you see the issue in?

Development version at ideditor.netlify.app

What version numbers does this issue effect?

2.31.0-dev

Which browsers are you seeing this problem on?

Firefox

@Nekzuris
Copy link
Contributor Author

Okay so this is because Firefox report a WheelEvent.deltaY of 102 for some reason, it's 100 on Chrome.
Chrome also scales it inversely proportional to page zoom, while Firefox just changes it to 108 🤷‍♂️.

I'm tempted to change this logic to hard code the zoom step but I'm not sure it will work great for all mice and trackpads.

function defaultWheelDelta(d3_event) {
return -d3_event.deltaY * (d3_event.deltaMode === 1 ? 0.05 : d3_event.deltaMode ? 1 : 0.002);
}

deltaY is also used here with many specific conditions:
var dY = source.deltaY;

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 a pull request may close this issue.

1 participant