Loading graphics/java/android/graphics/drawable/RippleDrawable.java +9 −8 Original line number Diff line number Diff line Loading @@ -1098,19 +1098,16 @@ public class RippleDrawable extends LayerDrawable { } // Draw the appropriate mask anchored to (0,0). final int saveCount = mMaskCanvas.save(); final int left = bounds.left; final int top = bounds.top; if (mState.mRippleStyle == STYLE_SOLID) { mMaskCanvas.translate(-left, -top); } if (maskType == MASK_EXPLICIT) { drawMask(mMaskCanvas); } else if (maskType == MASK_CONTENT) { drawContent(mMaskCanvas); } if (mState.mRippleStyle == STYLE_SOLID) { mMaskCanvas.translate(left, top); } mMaskCanvas.restoreToCount(saveCount); if (mState.mRippleStyle == STYLE_PATTERNED) { for (int i = 0; i < mRunningAnimations.size(); i++) { mRunningAnimations.get(i).getProperties().getShader().setShader(mMaskShader); Loading Loading @@ -1210,9 +1207,13 @@ public class RippleDrawable extends LayerDrawable { updateMaskShaderIfNeeded(); // Position the shader to account for canvas translation. if (mMaskShader != null && mState.mRippleStyle == STYLE_SOLID) { if (mMaskShader != null) { final Rect bounds = getBounds(); if (mState.mRippleStyle == STYLE_PATTERNED) { mMaskMatrix.setTranslate(bounds.left, bounds.top); } else { mMaskMatrix.setTranslate(bounds.left - x, bounds.top - y); } mMaskShader.setLocalMatrix(mMaskMatrix); } Loading Loading
graphics/java/android/graphics/drawable/RippleDrawable.java +9 −8 Original line number Diff line number Diff line Loading @@ -1098,19 +1098,16 @@ public class RippleDrawable extends LayerDrawable { } // Draw the appropriate mask anchored to (0,0). final int saveCount = mMaskCanvas.save(); final int left = bounds.left; final int top = bounds.top; if (mState.mRippleStyle == STYLE_SOLID) { mMaskCanvas.translate(-left, -top); } if (maskType == MASK_EXPLICIT) { drawMask(mMaskCanvas); } else if (maskType == MASK_CONTENT) { drawContent(mMaskCanvas); } if (mState.mRippleStyle == STYLE_SOLID) { mMaskCanvas.translate(left, top); } mMaskCanvas.restoreToCount(saveCount); if (mState.mRippleStyle == STYLE_PATTERNED) { for (int i = 0; i < mRunningAnimations.size(); i++) { mRunningAnimations.get(i).getProperties().getShader().setShader(mMaskShader); Loading Loading @@ -1210,9 +1207,13 @@ public class RippleDrawable extends LayerDrawable { updateMaskShaderIfNeeded(); // Position the shader to account for canvas translation. if (mMaskShader != null && mState.mRippleStyle == STYLE_SOLID) { if (mMaskShader != null) { final Rect bounds = getBounds(); if (mState.mRippleStyle == STYLE_PATTERNED) { mMaskMatrix.setTranslate(bounds.left, bounds.top); } else { mMaskMatrix.setTranslate(bounds.left - x, bounds.top - y); } mMaskShader.setLocalMatrix(mMaskMatrix); } Loading