Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9b327ea authored by Tony Wickham's avatar Tony Wickham
Browse files

Save and restore ClockIconDrawable canvas when modifying it

Test: Play "slot machine" animation where Clock icon is involved, ensure all icons in the animation draw normally
Bug: 180605356
Change-Id: I2ad4d1a02dbb399e4b92502d21d3974c57729d6d
parent 9bb10e0d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -25,10 +25,8 @@ import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect;
@@ -373,10 +371,12 @@ public class ClockDrawableWrapper extends AdaptiveIconDrawable implements Bitmap
            // prepare and draw the foreground
            mInfo.animInfo.applyTime(mTime, mForeground);

            int saveCount = canvas.save();
            canvas.scale(mInfo.scale, mInfo.scale,
                    bounds.exactCenterX() + mInfo.offset, bounds.exactCenterY() + mInfo.offset);
            canvas.clipPath(mFullDrawable.getIconMask());
            mForeground.draw(canvas);
            canvas.restoreToCount(saveCount);

            reschedule();
        }