Open X-Ryl669 opened 3 years ago
If you use a touchpad, it's very hard not to swipe vertically by a little bit while swiping horizontally. Thus, I think this line:
if (Math.abs(deltaX) > 0 && Math.abs(deltaY) == 0)
should read instead:
if (Math.abs(deltaX) > horzThreshold && Math.abs(deltaY) < vertThreshold)
or, just take the ratio (if you swipe more on horizontal axis than vertical axis):
var horzScale = 1e6; if (Math.abs(deltaX) / Math.abs(deltaY) > horzScale) // This works even if deltaY is zero, since +Inf > any number
@X-Ryl669 Would you like to make a pull request with the change?
If you use a touchpad, it's very hard not to swipe vertically by a little bit while swiping horizontally. Thus, I think this line:
should read instead:
or, just take the ratio (if you swipe more on horizontal axis than vertical axis):