diff options
author | 2025-01-27 10:32:48 -0800 | |
---|---|---|
committer | 2025-01-27 10:32:48 -0800 | |
commit | 9932da447b347d35e7fcc7da964139426e9fe3e2 (patch) | |
tree | 86f275f308fc1a9e036046b5dbaf1cda1d782f4b | |
parent | 50ba2435c2f03e7c2fd17c2b887b6f2f7c4d2a54 (diff) | |
parent | a45ee5a8307c967f247bcd65595ac3fb5bd38ca4 (diff) |
Merge "Round mSegRectF and mPointRectF coordinates to pixel size." into main
-rw-r--r-- | core/java/com/android/internal/widget/NotificationProgressDrawable.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/java/com/android/internal/widget/NotificationProgressDrawable.java b/core/java/com/android/internal/widget/NotificationProgressDrawable.java index 4ece81c24edc..30dcc67d9ce5 100644 --- a/core/java/com/android/internal/widget/NotificationProgressDrawable.java +++ b/core/java/com/android/internal/widget/NotificationProgressDrawable.java @@ -132,6 +132,8 @@ public final class NotificationProgressDrawable extends Drawable { final float centerY = (float) getBounds().centerY(); final int numParts = mParts.size(); + final float pointTop = Math.round(centerY - pointRadius); + final float pointBottom = Math.round(centerY + pointRadius); for (int iPart = 0; iPart < numParts; iPart++) { final DrawablePart part = mParts.get(iPart); final float start = left + part.mStart; @@ -146,12 +148,13 @@ public final class NotificationProgressDrawable extends Drawable { mFillPaint.setColor(segment.mColor); - mSegRectF.set(start, centerY - radiusY, end, centerY + radiusY); + mSegRectF.set(Math.round(start), Math.round(centerY - radiusY), Math.round(end), + Math.round(centerY + radiusY)); canvas.drawRoundRect(mSegRectF, cornerRadius, cornerRadius, mFillPaint); } else if (part instanceof DrawablePoint point) { // TODO: b/367804171 - actually use a vector asset for the default point // rather than drawing it as a box? - mPointRectF.set(start, centerY - pointRadius, end, centerY + pointRadius); + mPointRectF.set(Math.round(start), pointTop, Math.round(end), pointBottom); final float inset = mState.mPointRectInset; final float cornerRadius = mState.mPointRectCornerRadius; mPointRectF.inset(inset, inset); |