mirror of
https://github.com/nasa/openmct.git
synced 2025-06-06 01:11:41 +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,11 +382,19 @@ define(
|
|||||||
function onPinchStart(event, touch) {
|
function onPinchStart(event, touch) {
|
||||||
$scope.$emit('user:viewport:change:start');
|
$scope.$emit('user:viewport:change:start');
|
||||||
startZoom(touch.midpoint, touch.bounds, touch.touches, touch.distance);
|
startZoom(touch.midpoint, touch.bounds, touch.touches, touch.distance);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onPinchChange(event, touch) {
|
function onPinchChange(event, touch) {
|
||||||
|
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);
|
updateZoom(touch.midpoint, touch.bounds, touch.touches, touch.distance);
|
||||||
}
|
}
|
||||||
|
lastTouchDistance = touch.distance;
|
||||||
|
}
|
||||||
|
|
||||||
function onPanStart(event, touch) {
|
function onPanStart(event, touch) {
|
||||||
//startPan(touch.touch, touch.bounds);
|
//startPan(touch.touch, touch.bounds);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user