Question

So I am on a mission to make some custom progressbars. I have the following code:

for (ChildBar childBar : childBarArray) {
    canvas.drawArc(mBounds, childBar.getStartAngle(), childBar.getLength(), false,
    mCiruclarProgressBarPaint);
}

Which goes through an array with several children to draw several arches, spread out in the in the bounds, in a circle. This works just fine, however, I am not sure how to proceed if i wanted to "round" the corner of each arc at the start, and at the end. It does not look good just to start with a cut and end with a cut.

Does anybody know how to do what I am asking for?

Was it helpful?

Solution

Solved it with

double x = mBounds.centerX() + (mBounds.width() / 2) * Math.cos(angle * (Math.PI / 180.0));
double y = mBounds.centerY() + (mBounds.height() / 2) * Math.sin(angle * (Math.PI / 180.0));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top