Skip to content

Commit 352eab9

Browse files
Nanamareclaude
andcommitted
[CircularProgressIndicator] Fix full circle track seam artifact
When drawing a full circle (360°) track, drawArc() creates a visible seam at 0° where the start/end caps or rounded blocks overlap. Replace drawArc() with drawOval() for full circle tracks, which has no start/end point and renders a seamless circle. Partial arcs (indicators) continue to use drawArc() unchanged. Fixes #5027 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4b26950 commit 352eab9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

lib/java/com/google/android/material/progressindicator/CircularDrawingDelegate.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,18 @@ private void drawArc(
313313
&& shouldDrawActiveIndicator
314314
&& amplitudeFraction > 0f;
315315

316+
// Full circle: use drawOval to avoid seam artifact at the start/end point where caps overlap.
317+
if (arcDegree >= 360f && !shouldDrawWavyPath) {
318+
paint.setAntiAlias(true);
319+
paint.setColor(paintColor);
320+
paint.setStrokeWidth(displayedTrackThickness);
321+
paint.setStyle(Style.STROKE);
322+
paint.setStrokeCap(Cap.BUTT);
323+
arcBounds.set(-adjustedRadius, -adjustedRadius, adjustedRadius, adjustedRadius);
324+
canvas.drawOval(arcBounds, paint);
325+
return;
326+
}
327+
316328
// Sets up the paint.
317329
paint.setAntiAlias(true);
318330
paint.setColor(paintColor);

0 commit comments

Comments
 (0)