diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2018-06-28 11:33:23 -0700 |
---|---|---|
committer | Hyunyoung Song <hyunyoungs@google.com> | 2018-06-28 11:33:23 -0700 |
commit | 7d4ef41cb4fdebeec7b009c7997c5e7e9be0b00f (patch) | |
tree | 786419d377e53809ad3d46409190b0a969b229f0 /src/com/android/launcher3/graphics | |
parent | d63e6dff2888686b075547ded2c3ad7b236a45e3 (diff) | |
download | android_packages_apps_Trebuchet-7d4ef41cb4fdebeec7b009c7997c5e7e9be0b00f.tar.gz android_packages_apps_Trebuchet-7d4ef41cb4fdebeec7b009c7997c5e7e9be0b00f.tar.bz2 android_packages_apps_Trebuchet-7d4ef41cb4fdebeec7b009c7997c5e7e9be0b00f.zip |
Fix clipping issue on adaptive icons
Bug: 62372639
Change-Id: Ie9dcf18f61c45225823dfbbf85578edcbffd86b9
Diffstat (limited to 'src/com/android/launcher3/graphics')
-rw-r--r-- | src/com/android/launcher3/graphics/LauncherIcons.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/launcher3/graphics/LauncherIcons.java b/src/com/android/launcher3/graphics/LauncherIcons.java index 09ea1ad41..ece6c5840 100644 --- a/src/com/android/launcher3/graphics/LauncherIcons.java +++ b/src/com/android/launcher3/graphics/LauncherIcons.java @@ -337,15 +337,16 @@ public class LauncherIcons implements AutoCloseable { final int top = (textureHeight-height) / 2; mOldBounds.set(icon.getBounds()); + int offset = 0; if (Utilities.ATLEAST_OREO && icon instanceof AdaptiveIconDrawable) { - int offset = Math.max((int) Math.ceil(BLUR_FACTOR * textureWidth), Math.max(left, top)); + offset = Math.max((int) Math.ceil(BLUR_FACTOR * textureWidth), Math.max(left, top)); int size = Math.max(width, height); icon.setBounds(offset, offset, offset + size, offset + size); } else { icon.setBounds(left, top, left+width, top+height); } mCanvas.save(); - mCanvas.scale(scale, scale, textureWidth / 2, textureHeight / 2); + mCanvas.scale(scale, scale, textureWidth / 2 + offset, textureHeight / 2 + offset); icon.draw(mCanvas); mCanvas.restore(); icon.setBounds(mOldBounds); |