-
Notifications
You must be signed in to change notification settings - Fork 86
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
add threshold setting #84
Conversation
Add threshold setting to move only if mouse moves farther than threshold. Threshold setting can be a function.
Hi, a couple of thoughts on this. I'd prefer the threshold to work by keeping track of Start position and measuring against that at each step I think. Also, I know that sqrt isn't a particularly fast calculation. Whilst it's definitely more accurate it would be interesting to try and see if the experience works as well by just checking Y distance or X distance is greater than threshold relative to start position. Let me know your thoughts |
Alternatively if just counting down the threshold works better the property should probably be |
Please can you also update the read me and include a test with the threshold setting. Cheers |
Just add the test to the end of https://github.com/davetayls/jquery.kinetic/blob/master/test/specs/basic.spec.js 👌 |
https://jsperf.com/sqrt-vs-abs I don't think Math.sqrt will affect the performance especially since it is being used before the scrolling occurs . I agree it should be from starting position. I will fix that and create the tests. |
Not sure why the build fails. The tests pass when viewing them in any browser. |
I'll take a look later this morning |
Just had a quick look on my phone and they aren't passing, is this because of the changes you have made to how the threshold works? |
found the bug in the dragOver() function for the tests. the touch move event was moving to x,x instead of x,y and the threshold wasn't being crossed |
thanks @UziTech nice work, i'll merge this in and do a release 👍 |
Add threshold setting to move only if mouse moves farther than
threshold. Threshold setting can be a function.
fixes #83