public void handleTouchEvent ( MotionEvent ev ) { if ( ev . getAction ( ) == MotionEvent . ACTION_MOVE ) { // A finger is dragging about if ( mTexHeight != 0 && mTexWidth != 0 ) { mSummedTouchPosition [ 0 ] += ( 2 * ( ev . getX ( ) - mLastTouchPosition [ 0 ] ) ) / mTexWidth ; mSummedTouchPosition [ 1 ] += ( 2 * ( ev . getY ( ) - mLastTouchPosition [ 1 ] ) ) / - mTexHeight ; mLastTouchPosition [ 0 ] = ev . getX ( ) ; mLastTouchPosition [ 1 ] = ev . getY ( ) ; } } else if ( ev . getAction ( ) == MotionEvent . ACTION_DOWN ) { // The primary finger has landed mLastTouchPosition [ 0 ] = ev . getX ( ) ; mLastTouchPosition [ 1 ] = ev . getY ( ) ; } }
Configures the effect offset