From e5cdb6c8394e321266fb8940fdd0c97b2f87b2f3 Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Mon, 12 Sep 2011 14:21:46 -0700 Subject: [PATCH] Fix wobbly spinners Some progress bars use AnimatedRotateDrawable, which suffered from the same bug as AnimationDrawable (until a recent fix). The code would not account for the left/top offset of the drawable in its view, so it would rotate the drawable around the wrong center, causing it to wobble and not get erased properly. Change-Id: I3f34f797e595973d9eb1d952d92026c769c7ec0a --- .../java/android/graphics/drawable/AnimatedRotateDrawable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java b/graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java index 7c4e147cc49c0..34f90708afeec 100644 --- a/graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java +++ b/graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java @@ -79,7 +79,7 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac float px = st.mPivotXRel ? (w * st.mPivotX) : st.mPivotX; float py = st.mPivotYRel ? (h * st.mPivotY) : st.mPivotY; - canvas.rotate(mCurrentDegrees, px, py); + canvas.rotate(mCurrentDegrees, px + bounds.left, py + bounds.top); drawable.draw(canvas);