Ensure ripple mask is drawn at correct position

Bug: 22911708
Change-Id: Icdbe1f8a66d5e35eb25aa973c94f5870896cc1f8
This commit is contained in:
Alan Viverette
2015-08-11 14:25:45 -04:00
parent ad7719dea4
commit bac9769146

View File

@@ -786,12 +786,16 @@ public class RippleDrawable extends LayerDrawable {
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() {