Merge "Fix crash in ShapeDrawable" into jb-mr1-dev
This commit is contained in:
@@ -373,8 +373,16 @@ public class ShapeDrawable extends Drawable {
|
|||||||
@Override
|
@Override
|
||||||
public Drawable mutate() {
|
public Drawable mutate() {
|
||||||
if (!mMutated && super.mutate() == this) {
|
if (!mMutated && super.mutate() == this) {
|
||||||
mShapeState.mPaint = new Paint(mShapeState.mPaint);
|
if (mShapeState.mPaint != null) {
|
||||||
mShapeState.mPadding = new Rect(mShapeState.mPadding);
|
mShapeState.mPaint = new Paint(mShapeState.mPaint);
|
||||||
|
} else {
|
||||||
|
mShapeState.mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
}
|
||||||
|
if (mShapeState.mPadding != null) {
|
||||||
|
mShapeState.mPadding = new Rect(mShapeState.mPadding);
|
||||||
|
} else {
|
||||||
|
mShapeState.mPadding = new Rect();
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
mShapeState.mShape = mShapeState.mShape.clone();
|
mShapeState.mShape = mShapeState.mShape.clone();
|
||||||
} catch (CloneNotSupportedException e) {
|
} catch (CloneNotSupportedException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user