Code example for Path

Methods: quadTo

0
        } 
        private void touch_move(float x, float y) {
            float dx = Math.abs(x - mX);
            float dy = Math.abs(y - mY);
            if (dx >= TOUCH_TOLERANCE || dy >= TOUCH_TOLERANCE) {
                mPath.quadTo(mX, mY, (x + mX)/2, (y + mY)/2);
                mX = x;
                mY = y;
            } 
        } 
        private void touch_up() { 
            mPath.lineTo(mX, mY);
            // commit the path to our offscreen 
            mCanvas.drawPath(mPath, mPaint);
            // kill this so we don't double draw 
            mPath.reset();
        } 
         
        @Override 
        public boolean onTouchEvent(MotionEvent event) {
            float x = event.getX();