From 5a9619ce26c315e23fa3e6aced167aa927ec75e1 Mon Sep 17 00:00:00 2001 From: Shivam Dave Date: Wed, 2 Sep 2015 09:16:01 -0700 Subject: [PATCH] [Mobile] Clean Up Removed unneeded variables passed into MCTPlot functions. --- .../plot-reborn/src/directives/MCTPlot.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/platform/features/plot-reborn/src/directives/MCTPlot.js b/platform/features/plot-reborn/src/directives/MCTPlot.js index 17aa8e397a..88b997776e 100644 --- a/platform/features/plot-reborn/src/directives/MCTPlot.js +++ b/platform/features/plot-reborn/src/directives/MCTPlot.js @@ -322,14 +322,12 @@ define( }; } - function updateZoom(midpoint, bounds, touches, distance) { + function updateZoom(midpoint, bounds, distance) { // calculate offset between points. Apply that offset to viewport. var midpointPosition = trackTouchPosition(midpoint, bounds), newMidpointPosition = midpointPosition.positionAsPlotPoint, - newTouchPosition = [trackTouchPosition(touches[0], bounds).positionAsPlotPoint, - trackTouchPosition(touches[1], bounds).positionAsPlotPoint], - distanceRatio = lastTouchDistance / distance || firstTouchDistance / distance, - newViewport = calculateViewport(newMidpointPosition, newTouchPosition, distanceRatio); + distanceRatio = (lastTouchDistance / distance) || (firstTouchDistance / distance), + newViewport = calculateViewport(newMidpointPosition, distanceRatio); $scope.viewport = newViewport; } @@ -382,15 +380,14 @@ define( } function onPinchChange(event, touch) { - 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))) { //console.log("# PINCH PAN"); updatePan(touch.midpoint, touch.bounds); } else { //console.log("# PINCH ZOOM"); - updateZoom(touch.midpoint, touch.bounds, touch.touches, touch.distance); + updateZoom(touch.midpoint, touch.bounds, touch.distance); } lastTouchDistance = touch.distance; } @@ -403,7 +400,7 @@ define( updatePan(touch.touch, touch.bounds); } - function onTouchEnd(event) { + function onTouchEnd() { endTouch(); }