commit | f0d69b9e33e32b60bf953fc775b7843825e99036 | [log] [tgz] |
---|---|---|
author | Alan Viverette <alanv@google.com> | Thu Aug 20 16:27:21 2015 -0400 |
committer | Alan Viverette <alanv@google.com> | Thu Aug 20 16:27:21 2015 -0400 |
tree | d0c21b7d138c7c66443136c07a150309cab39da2 | |
parent | e3de6c5df5a94e627c5ee0f188cbb066233a3dd0 [diff] |
Translate ripple mask to account for drawable bounds Bug: 23354529 Change-Id: Iaa4fde6b37645492cf902f141f975bdef8e7e14e
diff --git a/graphics/java/android/graphics/drawable/RippleDrawable.java b/graphics/java/android/graphics/drawable/RippleDrawable.java index 32f6a89..464f3de 100644 --- a/graphics/java/android/graphics/drawable/RippleDrawable.java +++ b/graphics/java/android/graphics/drawable/RippleDrawable.java
@@ -855,7 +855,8 @@ // Position the shader to account for canvas translation. if (mMaskShader != null) { - mMaskMatrix.setTranslate(-x, -y); + final Rect bounds = getBounds(); + mMaskMatrix.setTranslate(bounds.left - x, bounds.top - y); mMaskShader.setLocalMatrix(mMaskMatrix); }