mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 15:56:49 +00:00
Fix clipping issue on adaptive icons
Bug: 62372639 Change-Id: Ie9dcf18f61c45225823dfbbf85578edcbffd86b9
This commit is contained in:
@@ -801,7 +801,7 @@ public class IconCache {
|
||||
}
|
||||
|
||||
private static final class IconDB extends SQLiteCacheHelper {
|
||||
private final static int RELEASE_VERSION = 23;
|
||||
private final static int RELEASE_VERSION = 24;
|
||||
|
||||
private final static String TABLE_NAME = "icons";
|
||||
private final static String COLUMN_ROWID = "rowid";
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user