From 003d56f8a1eee6825cc6c800f135e13df753770d Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Fri, 16 Aug 2013 06:50:35 +0200 Subject: [PATCH] care that starting pinch width is set as it should be --- js/map.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/map.js b/js/map.js index 77585e2..6aeacf6 100644 --- a/js/map.js +++ b/js/map.js @@ -489,7 +489,7 @@ var mapEvHandler = { Math.pow(aEvent.targetTouches.item(1).clientY - aEvent.targetTouches.item(0).clientY, 2) ); - console.log('!!!' + gPinchStartWidth); + console.log('!!! ' + gPinchStartWidth); } gDragTouchID = aEvent.changedTouches.item(0).identifier; coordObj = aEvent.changedTouches.identifiedTouch(gDragTouchID); @@ -513,6 +513,8 @@ var mapEvHandler = { Math.pow(aEvent.targetTouches.item(1).clientY - aEvent.targetTouches.item(0).clientY, 2) ); + if (!gPinchStartWidth) + gPinchStartWidth = curPinchStartWidth; console.log(gPinchStartWidth + ' ' + curPinchStartWidth); if (gPinchStartWidth / curPinchStartWidth > 1.7 || gPinchStartWidth / curPinchStartWidth < 0.6) { @@ -537,6 +539,9 @@ var mapEvHandler = { zoomIn(); else zoomOut(); + + // Reset pinch start width and start another pinch gesture. + gPinchStartWidth = null; } } break; -- 2.35.3