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

add threshold setting #84

Merged
merged 12 commits into from
Jun 23, 2015
Merged

add threshold setting #84

merged 12 commits into from
Jun 23, 2015

Conversation

UziTech
Copy link
Collaborator

@UziTech UziTech commented Jun 16, 2015

Add threshold setting to move only if mouse moves farther than
threshold. Threshold setting can be a function.
fixes #83

Add threshold setting to move only if mouse moves farther than
threshold. Threshold setting can be a function.
@UziTech UziTech changed the title add threshold setting fixes #83 add threshold setting Jun 16, 2015
@davetayls
Copy link
Owner

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

@davetayls
Copy link
Owner

Alternatively if just counting down the threshold works better the property should probably be moveThresholdRemaining

@davetayls
Copy link
Owner

Please can you also update the read me and include a test with the threshold setting. Cheers

@davetayls
Copy link
Owner

@UziTech
Copy link
Collaborator Author

UziTech commented Jun 18, 2015

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.

@UziTech
Copy link
Collaborator Author

UziTech commented Jun 18, 2015

Not sure why the build fails. The tests pass when viewing them in any browser.
https://rawgit.com/UziTech/jquery.kinetic/master/test/specs/basic.html

@davetayls
Copy link
Owner

I'll take a look later this morning

@davetayls
Copy link
Owner

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?

@UziTech
Copy link
Collaborator Author

UziTech commented Jun 22, 2015

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

@davetayls
Copy link
Owner

thanks @UziTech nice work, i'll merge this in and do a release 👍

@davetayls davetayls merged commit b40fc9c into davetayls:master Jun 23, 2015
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

Successfully merging this pull request may close these issues.

move threshold
2 participants