[Mobile] Clean Up

Changed variable placement
for amount of distance changed allowed
for a pinch drag.
This commit is contained in:
Shivam Dave 2015-09-02 09:23:25 -07:00
parent 5a9619ce26
commit 50d10639e1

View File

@ -9,7 +9,8 @@ define(
var RANGE_TICK_COUNT = 7,
DOMAIN_TICK_COUNT = 5,
ZOOM_AMT = 0.02;
ZOOM_AMT = 0.02,
PINCH_DRAG_AMT = 2;
function MCTPlot() {
@ -370,13 +371,14 @@ define(
function onPinchStart(event, touch) {
$scope.$emit('user:viewport:change:start');
startZoom(touch.midpoint, touch.bounds, touch.touches, touch.distance);
}
function comparePinchDrag(distance, firstDistance, lastDistance) {
var amt = 2;
return (((firstDistance + amt) >= distance) && ((firstDistance - amt) <= distance))
|| (((lastDistance + amt) >= distance) && ((lastDistance - amt) <= distance));
return (((firstDistance + PINCH_DRAG_AMT) >= distance) &&
((firstDistance - PINCH_DRAG_AMT) <= distance)) ||
(((lastDistance + PINCH_DRAG_AMT) >= distance) &&
((lastDistance - PINCH_DRAG_AMT) <= distance));
}
function onPinchChange(event, touch) {