mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 00:23:01 +00:00
[Mobile] Gestures
Added an endTouch/Zoom to the MCTPlot to mark when the user has canceled/ended their touch event.
This commit is contained in:
@ -44,6 +44,7 @@ define(
|
|||||||
marqueeRect, // Set when exists.
|
marqueeRect, // Set when exists.
|
||||||
chartElementBounds,
|
chartElementBounds,
|
||||||
firstTouches,
|
firstTouches,
|
||||||
|
firstTouch,
|
||||||
firstTouchDistance,
|
firstTouchDistance,
|
||||||
firstTouchPan,
|
firstTouchPan,
|
||||||
$canvas = $element.find('canvas');
|
$canvas = $element.find('canvas');
|
||||||
@ -313,16 +314,28 @@ define(
|
|||||||
function onPinchChange(event, touch) {
|
function onPinchChange(event, touch) {
|
||||||
updateZoom(touch.midpoint, touch.bounds, touch.touches, touch.distance);
|
updateZoom(touch.midpoint, touch.bounds, touch.touches, touch.distance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onPanStart(event, touch) {
|
||||||
|
startPan(touch.touch, touch.bounds);
|
||||||
|
}
|
||||||
|
|
||||||
function onPinchEnd(event) {
|
function onPanChange(event, touch) {
|
||||||
endZoom();
|
updatePan(touch.touch, touch.bounds);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onTouchEnd(event) {
|
||||||
|
endTouch();
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.$watchCollection('viewport', onViewportChange);
|
$scope.$watchCollection('viewport', onViewportChange);
|
||||||
|
|
||||||
|
$scope.$on('mct:pan:start', onPanStart);
|
||||||
|
$scope.$on('mct:pan:change', onPanChange);
|
||||||
|
|
||||||
$scope.$on('mct:pinch:start', onPinchStart);
|
$scope.$on('mct:pinch:start', onPinchStart);
|
||||||
$scope.$on('mct:pinch:change', onPinchChange);
|
$scope.$on('mct:pinch:change', onPinchChange);
|
||||||
$scope.$on('mct:pinch:end', onPinchEnd);
|
|
||||||
|
$scope.$on('mct:ptouch:end', onTouchEnd);
|
||||||
|
|
||||||
$scope.$on('$destroy', stopWatching);
|
$scope.$on('$destroy', stopWatching);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user