mirror of
https://github.com/nasa/openmct.git
synced 2025-05-31 14:40:48 +00:00
[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:
parent
29df378851
commit
5e1dd04e6d
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user