[Mobile] Pinch & Pan

Adjusted Pinch to check if
distance between 2 fingers
(rounded to whole number) is equal to
last distance or first distance, if this
is true, than will pan otherwise do
pinch zoom.
This commit is contained in:
Shivam Dave 2015-08-31 16:25:44 -07:00
parent 29df378851
commit 5e1dd04e6d

View File

@ -382,10 +382,18 @@ define(
function onPinchStart(event, touch) {
$scope.$emit('user:viewport:change:start');
startZoom(touch.midpoint, touch.bounds, touch.touches, touch.distance);
}
function onPinchChange(event, touch) {
updateZoom(touch.midpoint, touch.bounds, touch.touches, touch.distance);
console.log(Math.round(touch.distance));
if(Math.round(firstTouchDistance) === Math.round(touch.distance) ||
Math.round(lastTouchDistance) === Math.round(touch.distance)) {
updatePan(touch.midpoint, touch.bounds);
} else {
updateZoom(touch.midpoint, touch.bounds, touch.touches, touch.distance);
}
lastTouchDistance = touch.distance;
}
function onPanStart(event, touch) {