From 3eac183d8cb1d00d59dc4a7ebf6c472f8db23e86 Mon Sep 17 00:00:00 2001 From: Hal Blackburn Date: Tue, 26 Feb 2013 11:50:11 +0000 Subject: [PATCH] Fix handling of touchmove events on Android Dragging the canvas did not work on Android devices as the === check for lastTouch and the current event was always evaluating to false. Presumably Safari on iOS re-uses the same Touch object for touchmove events with the same finger, whereas Chrome/Firefox on Android creates new Touch objects for each event (so the === evaluates false). The code now compares Touch.identifier to ensure the new touch event is from the same finger as the initiating touchstart. --- src/mousetracker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mousetracker.js b/src/mousetracker.js index 391d2f0b..9fd9ffbe 100644 --- a/src/mousetracker.js +++ b/src/mousetracker.js @@ -943,7 +943,7 @@ if( event.touches.length === 1 && event.targetTouches.length === 1 && event.changedTouches.length === 1 && - THIS[ tracker.hash ].lastTouch === event.touches[ 0 ]){ + THIS[ tracker.hash ].lastTouch.identifier === event.touches[ 0 ].identifier){ onMouseMove( tracker, event.touches[ 0 ] );