-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Bug 1392361 - Fix zooming sensitivity on macOS #12203
Conversation
I tested this on Firefox Nightly with the following inputs:
Also tested on Chrome on macOS with trackpad pinch and ctrl+scroll. In all cases the behaviour seemed reasonable. |
There's a deployed version at https://mozilla.staktrace.com/tmp/fixzoom/generic/web/viewer.html if you want to try yourself. |
Unfortunately this performs significantly worse when using a mouse with a scrollwheel, in my case a Logitech G403, on Windows. I've testing using Ctrl+scrollwheel up, one increment at a time, and get the following sequence of zoom values:
|
Indeed, I can reproduce. I should have tried that before submitting the patch, sorry. Fix coming. |
Hm so actually this is because Windows defaults to three lines per mousewheel roll on line-based devices. On macOS it seems to default to 1. I guess for line-based devices we should consider one tick per event or something, since line-based devices are generally wheels with clicky wheels and one click would nicely correspond to one zoom step. |
The original code would get a long sequence of miniscule "tick" values while pinch-zooming, and each tick value would cause a 1.1x zoom. So even the smallest pinch gesture on a trackpad would cause high amounts of zoom. This patch accumulates the wheel deltas until they reach an integer threshold (with a tweak of the scaling factor to make it feel more natural) at which point it triggers the zoom based on the integer component of the accumulated delta. The fractional part is retained in the accumulator.
Patch updated. New version is deployed at https://mozilla.staktrace.com/tmp/fixzoom2/generic/web/viewer.html - please give it a whirl and let me know how it feels. |
That's looks/feels much better, thank you! /botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/b004d9813ca068a/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/b004d9813ca068a/output.txt Total script time: 3.22 mins Published |
Thank you for fixing this! |
The original code would get a long sequence of miniscule "tick" values while
pinch-zooming, and each tick value would cause a 1.1x zoom. So even the smallest
pinch gesture on a trackpad would cause high amounts of zoom. This patch
accumulates the wheel deltas until they reach an integer threshold (with a
tweak of the scaling factor to make it feel more natural) at which point it
triggers the zoom based on the integer component of the accumulated delta. The
fractional part is retained in the accumulator.
Fixes #8802