am 570a2363: am a8431e8c: am bfd62580: am 11104791: Merge "Ensure ripple mask is drawn at correct position" into mnc-dev
* commit '570a2363c8f80e94fbd6433e0c7f655a7350ad04':
Ensure ripple mask is drawn at correct position
diff --git a/graphics/java/android/graphics/drawable/RippleDrawable.java b/graphics/java/android/graphics/drawable/RippleDrawable.java
index bf069d3..32f6a89 100644
--- a/graphics/java/android/graphics/drawable/RippleDrawable.java
+++ b/graphics/java/android/graphics/drawable/RippleDrawable.java
@@ -786,12 +786,16 @@
mMaskColorFilter = new PorterDuffColorFilter(0, PorterDuff.Mode.SRC_IN);
}
- // Draw the appropriate mask.
+ // Draw the appropriate mask anchored to (0,0).
+ final int left = bounds.left;
+ final int top = bounds.top;
+ mMaskCanvas.translate(-left, -top);
if (maskType == MASK_EXPLICIT) {
drawMask(mMaskCanvas);
} else if (maskType == MASK_CONTENT) {
drawContent(mMaskCanvas);
}
+ mMaskCanvas.translate(left, top);
}
private int getMaskType() {