Code example for Path

Methods: arcTocloselineToreset

0
     
    /** 
     * Updates the internal data required to draw. 
     */ 
    private void update() { 
        mPath.reset();
         
        mStartPoint.x = (float)(Math.sin(Math.toRadians(mStartAngle + 90.0)) * (mOval.width() / 2.0)) + getCenterX();
        mStartPoint.y = (float)(-Math.cos(Math.toRadians(mStartAngle + 90.0)) * (mOval.height() / 2.0)) + getCenterY();
        mEndPoint.x = (float)(Math.sin(Math.toRadians(mStartAngle + mAngleExtent + 90.0)) * (mOval.width() / 2.0)) + getCenterX();
        mEndPoint.y = (float)(-Math.cos(Math.toRadians(mStartAngle + mAngleExtent + 90.0)) * (mOval.height() / 2.0)) + getCenterY();
         
        mPath.arcTo(mOval, mStartAngle, mAngleExtent);
        if (mUseCenter) {
            mPath.lineTo(mOval.centerX(), mOval.centerY());
        } 
        mPath.close();
        mRegion = new Region((int)mOval.left, (int)mOval.top, (int) mOval.right, (int) mOval.bottom);
        mRegion.setPath(mPath, mRegion);
    } 
 
    /** 
Stop searching for code, let great code find you!  Add Codota to your java IDE