Code example for Path

Methods: computeBoundslineTo

0
     */ 
    public void addPoint(float x, float y) {
        if (mFirstPoint) {
            mPath.moveTo(x, y);
        } else { 
            mPath.lineTo(x, y);
        } 
        update(); 
    } 
     
    /** 
     * Clears all lines. 
     */ 
    public void reset() { 
        mPath.reset();
        update(); 
    } 
 
    /** 
     * Updates the internal data required to draw. 
     */ 
    public void update() { 
        updateTempPath(); 
         
        RectF rect = new RectF();
        mPath.computeBounds(rect, false);
        mRegion = new Region((int) rect.left, (int) rect.top, (int) rect.right, (int) rect.bottom);
        mRegion.setPath(mClosedTempPath, mRegion);
    } 
 
    private void updateTempPath() {