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

Requires some margin to trigger #3

Open
X-Ryl669 opened this issue Nov 3, 2020 · 1 comment
Open

Requires some margin to trigger #3

X-Ryl669 opened this issue Nov 3, 2020 · 1 comment

Comments

@X-Ryl669
Copy link

X-Ryl669 commented Nov 3, 2020

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
@totu
Copy link
Owner

totu commented Nov 16, 2020

@X-Ryl669 Would you like to make a pull request with the change?

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

No branches or pull requests

2 participants