MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / touchmove

Function touchmove

public/iframe/lib/js/TrackballControls.js:646–672  ·  view source on GitHub ↗
( event )

Source from the content-addressed store, hash-verified

644 }
645
646 function touchmove( event ) {
647
648 if ( scope.enabled === false ) return;
649
650 event.preventDefault();
651 event.stopPropagation();
652
653 switch ( event.touches.length ) {
654
655 case 1:
656 _movePrev.copy( _moveCurr );
657 _moveCurr.copy( getMouseOnCircle( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ) );
658 break;
659
660 default: // 2 or more
661 var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;
662 var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;
663 _touchZoomDistanceEnd = Math.sqrt( dx * dx + dy * dy );
664
665 var x = ( event.touches[ 0 ].pageX + event.touches[ 1 ].pageX ) / 2;
666 var y = ( event.touches[ 0 ].pageY + event.touches[ 1 ].pageY ) / 2;
667 _panEnd.copy( getMouseOnScreen( x, y ) );
668 break;
669
670 }
671
672 }
673
674 function touchend( event ) {
675

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected