You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While we were implementing this library, I (using windows) got into a bit of a disagreement with our designer (using a mac) about the zoom speed. He was saying it was way too fast, while I was saying it felt just right.
That's when I discovered polling rates and what exactly deltaY means. In short: mac trackpads have a much higher polling rate, and therefore a lower delta value, and vice versa for my mouse wheel. If you want a consistent experience with zoomWithWheel, I advise taking the delta into consideration, as different mice/trackpads will have different polling rates and delta values.
We ended up doing the calculation ourselves, but if you're curious what the code is:
The above calculation worked well for me on a Mac with a trackpad.
Correct me if I'm wrong, but shouldn't you gate the above suggested calculation behind a check that event.deltaMode is 0? Presumably, the existence of event.deltaMode means that not all devices have a real pixel delta where such a calculation makes sense. For other values of deltaMode, maybe the current implementation with a step makes more sense.
Describe the bug
First of all, great library.
One slight issue with
zoomWithWheel
is this line:While we were implementing this library, I (using windows) got into a bit of a disagreement with our designer (using a mac) about the zoom speed. He was saying it was way too fast, while I was saying it felt just right.
That's when I discovered polling rates and what exactly
deltaY
means. In short: mac trackpads have a much higher polling rate, and therefore a lower delta value, and vice versa for my mouse wheel. If you want a consistent experience withzoomWithWheel
, I advise taking the delta into consideration, as different mice/trackpads will have different polling rates and delta values.We ended up doing the calculation ourselves, but if you're curious what the code is:
This resulted in a consistent experience and the designer and myself both agree that the zooming now feels right.
Your environment
The text was updated successfully, but these errors were encountered: