mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 23:36:47 +00:00
Fix clipping issue on adaptive icons
Bug: 62372639 Verified the one last device, b***line. Change-Id: I1d97d0cbe0afe76ee21de5964abf639fb4c0fceb
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user