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
Because of the calculation done in eastOutQuart, the zoom function can get into a state, where it tries to get infinity closer to the min or max value, but never actually get there. (Especially when using the trackpad on a Mac).
var tickZoom = easeOutQuart(step, curPerc, perc - curPerc, 16);
Also with the mouse wheel count set to 5, it usually ends with a zoom value of 101 or 102, before the check stops further zooming out:
var MOUSE_WHEEL_COUNT = 5; // A mouse delta after which it should stop preventing default behaviour of mouse wheel
A quick work around is adding a simple reset function after the easeOut function:
if (tickZoom < 102) {
tickZoom = 100
}
if (tickZoom > (maxZoom-2)) {
tickZoom = maxZoom
}
Which will make sure, that it hits the Min and Max values, instead of just getting infinity closer, but it isn't really a nice solution.
By adding a console.log statement, which outputs the zoom values, we can see that after 5-6 clicks, the function never gets to 100. After about 80 mouse wheel events, it will round it down to 100. The same is true for getting closer to MaxZoom
Because of the calculation done in eastOutQuart, the zoom function can get into a state, where it tries to get infinity closer to the min or max value, but never actually get there. (Especially when using the trackpad on a Mac).
Also with the mouse wheel count set to 5, it usually ends with a zoom value of 101 or 102, before the check stops further zooming out:
A quick work around is adding a simple reset function after the easeOut function:
Which will make sure, that it hits the Min and Max values, instead of just getting infinity closer, but it isn't really a nice solution.
By adding a console.log statement, which outputs the zoom values, we can see that after 5-6 clicks, the function never gets to 100. After about 80 mouse wheel events, it will round it down to 100. The same is true for getting closer to MaxZoom
The text was updated successfully, but these errors were encountered: