packages/apps/Launcher3
修订版 | 9279496e542e6dee3355e19e4a696e800873ee96 (tree) |
---|---|
时间 | 2017-06-07 05:21:11 |
作者 | Hyunyoung Song <hyunyoungs@goog...> |
Commiter | Hyunyoung Song |
Prevent clipping on the top and left side on AdaptiveIconDrawables
b/62372639
Change-Id: I0b2c0daecba2904f3e89f7b0b558d9b10f5dcbf6
@@ -266,9 +266,10 @@ public class LauncherIcons { | ||
266 | 266 | |
267 | 267 | sOldBounds.set(icon.getBounds()); |
268 | 268 | if (Utilities.isAtLeastO() && icon instanceof AdaptiveIconDrawable) { |
269 | - int offset = Math.min(left, top); | |
269 | + int offset = Math.max((int)(ShadowGenerator.BLUR_FACTOR * iconBitmapSize), | |
270 | + Math.min(left, top)); | |
270 | 271 | int size = Math.max(width, height); |
271 | - icon.setBounds(offset, offset, offset + size, offset + size); | |
272 | + icon.setBounds(offset, offset, size, size); | |
272 | 273 | } else { |
273 | 274 | icon.setBounds(left, top, left+width, top+height); |
274 | 275 | } |
@@ -35,7 +35,7 @@ public class ShadowGenerator { | ||
35 | 35 | |
36 | 36 | // Percent of actual icon size |
37 | 37 | private static final float HALF_DISTANCE = 0.5f; |
38 | - private static final float BLUR_FACTOR = 0.5f/48; | |
38 | + public static final float BLUR_FACTOR = 0.5f/48; | |
39 | 39 | |
40 | 40 | // Percent of actual icon size |
41 | 41 | private static final float KEY_SHADOW_DISTANCE = 1f/48; |