diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2018-06-28 15:17:51 -0700 |
---|---|---|
committer | Hyunyoung Song <hyunyoungs@google.com> | 2018-06-28 15:19:05 -0700 |
commit | 82d0835fa53962b149256deeb66509c0cccd5906 (patch) | |
tree | 76ffe053a670173d6d7d885218eb192c5f6865c9 | |
parent | 7d4ef41cb4fdebeec7b009c7997c5e7e9be0b00f (diff) | |
download | android_packages_apps_Trebuchet-82d0835fa53962b149256deeb66509c0cccd5906.tar.gz android_packages_apps_Trebuchet-82d0835fa53962b149256deeb66509c0cccd5906.tar.bz2 android_packages_apps_Trebuchet-82d0835fa53962b149256deeb66509c0cccd5906.zip |
Fix clipping issue on adaptive icons
Bug: 62372639
Verified the one last device, b***line.
Change-Id: I1d97d0cbe0afe76ee21de5964abf639fb4c0fceb
-rw-r--r-- | src/com/android/launcher3/graphics/LauncherIcons.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/com/android/launcher3/graphics/LauncherIcons.java b/src/com/android/launcher3/graphics/LauncherIcons.java index ece6c5840..333fe5907 100644 --- a/src/com/android/launcher3/graphics/LauncherIcons.java +++ b/src/com/android/launcher3/graphics/LauncherIcons.java @@ -337,16 +337,15 @@ 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) { - offset = Math.max((int) Math.ceil(BLUR_FACTOR * textureWidth), Math.max(left, top)); + int 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); + icon.setBounds(offset, offset, size - offset, size - offset); } else { icon.setBounds(left, top, left+width, top+height); } mCanvas.save(); - mCanvas.scale(scale, scale, textureWidth / 2 + offset, textureHeight / 2 + offset); + mCanvas.scale(scale, scale, textureWidth / 2, textureHeight / 2); icon.draw(mCanvas); mCanvas.restore(); icon.setBounds(mOldBounds); |