soyjavi / QuoJS

Micro #JavaScript Library for Mobile Devices
MIT License
2.07k stars 236 forks source link

Pinching events prevented during threshold constraint #60

Open frankayars opened 11 years ago

frankayars commented 11 years ago

Pinching will stop sending "pinching" events while the difference between fingers is within the range -10 and 10.

_capturePinch = function() { var diff, distance; distance = parseInt(_distance(CURRENT_TOUCH), 10); diff = GESTURE.initial_distance - distance; if (Math.abs(diff) > 10) { GESTURE.distance_difference = diff; return _trigger("pinching", { distance: diff }); } };

This logic is useful to initially determine a "pinching" threshold but causes issues when users pinches in/out (without lifting from the pinch gesture) and reaches the threshold.