Skip to content

Commit

Permalink
Ensuring that we restore bounds when resizing them for folder preview…
Browse files Browse the repository at this point in the history
… drawing. (Bug 11203738)

Change-Id: I0cef3916217bd3808363cafcfb25c2cd140f35fc
  • Loading branch information
Winson Chung committed Oct 14, 2013
1 parent 01c0214 commit d4e53c8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/com/android/launcher3/FolderIcon.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public class FolderIcon extends LinearLayout implements FolderListener {
private int mPreviewOffsetY;
private float mMaxPerspectiveShift;
boolean mAnimating = false;
private Rect mOldBounds = new Rect();

private PreviewItemDrawingParams mParams = new PreviewItemDrawingParams(0, 0, 0, 0);
private PreviewItemDrawingParams mAnimParams = new PreviewItemDrawingParams(0, 0, 0, 0);
Expand Down Expand Up @@ -534,13 +535,15 @@ private void drawPreviewItem(Canvas canvas, PreviewItemDrawingParams params) {
Drawable d = params.drawable;

if (d != null) {
mOldBounds.set(d.getBounds());
d.setBounds(0, 0, mIntrinsicIconSize, mIntrinsicIconSize);
d.setFilterBitmap(true);
d.setColorFilter(Color.argb(params.overlayAlpha, 255, 255, 255),
PorterDuff.Mode.SRC_ATOP);
d.draw(canvas);
d.clearColorFilter();
d.setFilterBitmap(false);
d.setBounds(mOldBounds);
}
canvas.restore();
}
Expand Down

0 comments on commit d4e53c8

Please sign in to comment.