[Mobile] Gestures

Fixed the range of values for
differentiating between pan and
pinch zoom to not assign the +2/-2
value to the variable.
This commit is contained in:
Shivam Dave 2015-09-01 12:15:48 -07:00
parent 5be6e90388
commit c8ca1deb9b

View File

@ -383,12 +383,12 @@ define(
function comparePinchDrag(distance, firstDistance, lastDistance) { function comparePinchDrag(distance, firstDistance, lastDistance) {
var amt = 2; var amt = 2;
return (((firstDistance += amt) >= distance) && ((firstDistance -= amt) <= distance)) return (((firstDistance + amt) >= distance) && ((firstDistance - amt) <= distance))
|| (((lastDistance += amt) >= distance) && ((lastDistance -= amt) <= distance)); || (((lastDistance + amt) >= distance) && ((lastDistance - amt) <= distance));
} }
function onPinchChange(event, touch) { function onPinchChange(event, touch) {
//console.log(Math.round(touch.distance)); console.log(Math.round(touch.distance));
if(comparePinchDrag(Math.round(touch.distance), Math.round(firstTouchDistance), if(comparePinchDrag(Math.round(touch.distance), Math.round(firstTouchDistance),
Math.round(lastTouchDistance))) { Math.round(lastTouchDistance))) {