public void addArc ( float left , float top , float right , float bottom , float startAngle , float sweepAngle ) { PathArcOperation operation = new PathArcOperation ( left , top , right , bottom ) ; operation . startAngle = startAngle ; operation . sweepAngle = sweepAngle ; operations . add ( operation ) ; ArcShadowOperation arcShadowOperation = new ArcShadowOperation ( operation ) ; float endAngle = startAngle + sweepAngle ; // Flip the startAngle and endAngle when drawing the shadow inside the bounds. They represent // the angles from the center of the circle to the start or end of the arc, respectively. When // the shadow is drawn inside the arc, it is going the opposite direction. boolean drawShadowInsideBounds = sweepAngle < 0 ; addShadowCompatOperation ( arcShadowOperation , drawShadowInsideBounds ? ( 180 + startAngle ) % 360 : startAngle , drawShadowInsideBounds ? ( 180 + endAngle ) % 360 : endAngle ) ; endX = ( left + right ) * 0.5f + ( right - left ) / 2 * ( float ) Math . cos ( Math . toRadians ( startAngle + sweepAngle ) ) ; endY = ( top + bottom ) * 0.5f + ( bottom - top ) / 2 * ( float ) Math . sin ( Math . toRadians ( startAngle + sweepAngle ) ) ; }
Add an arc to the ShapePath .