mirror of
https://github.com/nasa/openmct.git
synced 2025-05-21 17:57:39 +00:00
[Mobile] Gestures
Fixed the range of values for differentiating between pan and pinch zoom to not assign the +2/-2 value to the variable.
This commit is contained in:
parent
5be6e90388
commit
c8ca1deb9b
@ -383,12 +383,12 @@ define(
|
|||||||
|
|
||||||
function comparePinchDrag(distance, firstDistance, lastDistance) {
|
function comparePinchDrag(distance, firstDistance, lastDistance) {
|
||||||
var amt = 2;
|
var amt = 2;
|
||||||
return (((firstDistance += amt) >= distance) && ((firstDistance -= amt) <= distance))
|
return (((firstDistance + amt) >= distance) && ((firstDistance - amt) <= distance))
|
||||||
|| (((lastDistance += amt) >= distance) && ((lastDistance -= amt) <= distance));
|
|| (((lastDistance + amt) >= distance) && ((lastDistance - amt) <= distance));
|
||||||
}
|
}
|
||||||
|
|
||||||
function onPinchChange(event, touch) {
|
function onPinchChange(event, touch) {
|
||||||
//console.log(Math.round(touch.distance));
|
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))) {
|
Math.round(lastTouchDistance))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user