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

Swipe recognizer using overall gesture direction and velocity instead of last interval #669

Closed
wants to merge 4 commits into from

Conversation

annam
Copy link
Contributor

@annam annam commented Sep 17, 2014

Related to issue #640. Swipe recogniser should depend on overall direction (offsetDirection) and overall velocity (overallVelocity) instead of the ones of the last interval. Makes this more sensitive to swipes that slow down before touchend.

Added "overallVelocity" property in input which takes into account the total gesture time and the overall distance moved.

Prerequisite to fix issue #639 where the inverse value was returned for offsetDirection, also fixed in this PR.

also added a fix for swipe incorrectly triggering after pinch/rotate if one finger touchends before the other.

if horizontal direction is negative, it should return “Left”, not
“Right”.

this resulted in direction and offsetDirection properties to have
opposite values
swipe should detect the overall swipe direction, not the last interval
one

more importantly, it should use the overall velocity, so that if you’ve
swiped but slowed the motion down before touchend, swipe is still
detected.

need to capture overallVelocity for these tests, which we didn’t have
if after pinch/rotate, one finger touchends before the other, swipe is
incorrectly triggered because the last gesture is a single-touch
gesture. this checked for maximum pointers in gesture
@lobsterdore
Copy link

I think swipe is fairly broken until you apply this patch, this should be merged asap.

@neil-s
Copy link

neil-s commented Apr 6, 2015

Admins, could this PR be merged please?

@owenversteeg
Copy link

Probably not getting merged until #749 gets resolved, unfortunately

@arschmitz
Copy link
Contributor

Hi we will look into this ASAP once we finish trying to clean up the issues a little. Hoping to do a quick patch release with this and some other fixes.

@runspired
Copy link
Contributor

Related to #806, #748, #730

@arschmitz
Copy link
Contributor

Reading over this i think this seems like the correct change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants