From 96a05d7e86e10c4f1624a1af075bdcc3f335305d Mon Sep 17 00:00:00 2001 From: Yuriy Budiyev Date: Thu, 23 Nov 2017 16:25:28 +0300 Subject: [PATCH] Dev --- .../android/circularprogressbar/CircularProgressBar.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/budiyev/android/circularprogressbar/CircularProgressBar.java b/src/main/java/com/budiyev/android/circularprogressbar/CircularProgressBar.java index a85b536..3dc8ff0 100644 --- a/src/main/java/com/budiyev/android/circularprogressbar/CircularProgressBar.java +++ b/src/main/java/com/budiyev/android/circularprogressbar/CircularProgressBar.java @@ -333,7 +333,11 @@ protected void onDraw(Canvas canvas) { float maximum = mMaximum; float progress = mProgress; start = mStartAngle; - sweep = 360f * (Math.abs(progress) >= Math.abs(maximum) ? 1f : progress / maximum); + if (Math.abs(progress) >= Math.abs(maximum)) { + sweep = 360f; + } else { + sweep = progress / maximum * 360f; + } } canvas.drawArc(mDrawRect, start, sweep, false, mForegroundStrokePaint); }