File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
graphics/java/android/graphics/drawable Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -373,8 +373,16 @@ public ConstantState getConstantState() {
373373 @ Override
374374 public Drawable mutate () {
375375 if (!mMutated && super .mutate () == this ) {
376- mShapeState .mPaint = new Paint (mShapeState .mPaint );
377- mShapeState .mPadding = new Rect (mShapeState .mPadding );
376+ if (mShapeState .mPaint != null ) {
377+ mShapeState .mPaint = new Paint (mShapeState .mPaint );
378+ } else {
379+ mShapeState .mPaint = new Paint (Paint .ANTI_ALIAS_FLAG );
380+ }
381+ if (mShapeState .mPadding != null ) {
382+ mShapeState .mPadding = new Rect (mShapeState .mPadding );
383+ } else {
384+ mShapeState .mPadding = new Rect ();
385+ }
378386 try {
379387 mShapeState .mShape = mShapeState .mShape .clone ();
380388 } catch (CloneNotSupportedException e ) {
You can’t perform that action at this time.
0 commit comments