Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7634e5e5 authored by Adrian Roos's avatar Adrian Roos Committed by android-build-merger
Browse files

Wallpaper: Fix letterboxing if wallpaper is scaled but not cropped am: 5c97ff23

am: 865f437e

Change-Id: I2ea3832611f0e5a707b49be80e80b546d5636081
parents 1dd614db 865f437e
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -352,9 +352,17 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
                        (cropHint.right > options.outWidth ? options.outWidth - cropHint.right : 0),
                        (cropHint.bottom > options.outHeight ? options.outHeight - cropHint.bottom : 0));

                // If the crop hint was larger than the image we just overshot. Patch things up.
                if (cropHint.left < 0) {
                    cropHint.left = 0;
                }
                if (cropHint.top < 0) {
                    cropHint.top = 0;
                }

                // Don't bother cropping if what we're left with is identity
                needCrop = (options.outHeight > cropHint.height()
                        && options.outWidth > cropHint.width());
                        || options.outWidth > cropHint.width());
            }

            // scale if the crop height winds up not matching the recommended metrics