Code example for Path

Methods: quadTosetLastPoint

0
		float dy = Math.abs( y - mY );
 
		if ( dx >= TOUCH_TOLERANCE || dy >= TOUCH_TOLERANCE ) {
 
			if ( !mMoved ) {
				tmpPath.setLastPoint( mX, mY );
			} 
 
			mMoved = true;
 
			if ( mRestiction > 0 ) {
				double r = Math.sqrt( Math.pow( x - mStartX, 2 ) + Math.pow( y - mStartY, 2 ) );
				double theta = Math.atan2( y - mStartY, x - mStartX );
 
				final float w = getWidth();
				final float h = getHeight();
 
				double scale = ( mRestiction / mCurrentScale ) / (double) ( w + h ) / ( mBrushSize / mCurrentScale );
				double rNew = Math.log( r * scale + 1 ) / scale;
 
				x = (float) ( mStartX + rNew * Math.cos( theta ) );
				y = (float) ( mStartY + rNew * Math.sin( theta ) );
			} 
 
			tmpPath.quadTo( mX, mY, ( x + mX ) / 2, ( y + mY ) / 2 );
			mX = x;
			mY = y;
		} 
 
		if ( mDrawListener != null ) {