Merge "Prevent clipping on the top and left side on AdaptiveIconDrawables b/62372639" into ub-launcher3-dorval
diff --git a/src/com/android/launcher3/graphics/LauncherIcons.java b/src/com/android/launcher3/graphics/LauncherIcons.java
index 53521f2..19e57024 100644
--- a/src/com/android/launcher3/graphics/LauncherIcons.java
+++ b/src/com/android/launcher3/graphics/LauncherIcons.java
@@ -266,9 +266,10 @@
 
             sOldBounds.set(icon.getBounds());
             if (Utilities.isAtLeastO() && icon instanceof AdaptiveIconDrawable) {
-                int offset = Math.min(left, top);
+                int offset = Math.max((int)(ShadowGenerator.BLUR_FACTOR * iconBitmapSize),
+                        Math.min(left, top));
                 int size = Math.max(width, height);
-                icon.setBounds(offset, offset, offset + size, offset + size);
+                icon.setBounds(offset, offset, size, size);
             } else {
                 icon.setBounds(left, top, left+width, top+height);
             }
diff --git a/src/com/android/launcher3/graphics/ShadowGenerator.java b/src/com/android/launcher3/graphics/ShadowGenerator.java
index 469fe34..5d8cca8 100644
--- a/src/com/android/launcher3/graphics/ShadowGenerator.java
+++ b/src/com/android/launcher3/graphics/ShadowGenerator.java
@@ -35,7 +35,7 @@
 
     // Percent of actual icon size
     private static final float HALF_DISTANCE = 0.5f;
-    private static final float BLUR_FACTOR = 0.5f/48;
+    public static final float BLUR_FACTOR = 0.5f/48;
 
     // Percent of actual icon size
     private static final float KEY_SHADOW_DISTANCE = 1f/48;