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

Android 2.2 change for when event scale is undefined #24

Closed
ColinGrant opened this issue Jan 21, 2012 · 2 comments
Closed

Android 2.2 change for when event scale is undefined #24

ColinGrant opened this issue Jan 21, 2012 · 2 comments

Comments

@ColinGrant
Copy link

Great library. I use it on iPhone devices. I just ported to Android 2.2 and found a necessary change. Not sure why I had to do this.

In the onTouchMove() function there is a test to ignore pinch/zoom gestures. Specifically there is a test against the scale of the event:

// ensure swiping with one touch and not pinching
if(e.touches.length > 1 || e.scale !== 1) return;

On a Motorola Droid 2 running OS 2.2 the e.scale member variable is always undefined for a swipe. "undefined !== 1" and thus the onTouchMove event handler never gets past this test. In my copy of your library I added the following hack just before the test:

if (e.scale == undefined) {
// Not sure what it means, but its not a pinch/zoom event
e.scale = 1;
}

@thebird
Copy link
Owner

thebird commented Feb 7, 2012

This should have taken care of the problem:

https://github.com/bradbirdsall/Swipe/blob/master/swipe.js#L204

@ColinGrant
Copy link
Author

Hi Brad,

Great - I'll test the latest library and let you know if there is still a problem.

Regards,
Colin

On Feb 7, 2012, at 6:49 PM, Brad Birdsall wrote:

This should have taken care of the problem:

https://github.com/bradbirdsall/Swipe/blob/master/swipe.js#L204


Reply to this email directly or view it on GitHub:
https://github.com/bradbirdsall/Swipe/issues/24#issuecomment-3859555

@thebird thebird closed this as completed Feb 22, 2012
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