Code example for Path

Methods: computeBoundstransform

0
     * {@inheritDoc} 
     */ 
    public void translate(float x, float y) {
        Matrix mat = new Matrix();
        mat.postTranslate(x, y);
        mPath.transform(mat);
        update(); 
    } 
     
    /** 
     * Appends the specified point to this polygon. 
     * @param x The x-coordinate of specified point 
     * @param y The y-coordinate of specified point 
     */ 
    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() { 
Contextual code suggestions in your IDE  Get Codota for Java