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

Commit 759a21c2 authored by Aurélien Pomini's avatar Aurélien Pomini Committed by Android (Google) Code Review
Browse files

Merge "Fix 1px rounding error" into main

parents e5834251 86b7e8d0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -746,8 +746,8 @@ public class WallpaperCropper {
                    final ImageDecoder.Source srcData =
                            ImageDecoder.createSource(wallpaper.getWallpaperFile());
                    final int finalScale = scale;
                    final int rescaledBitmapWidth = (int) (0.5f + bitmapSize.x / sampleSize);
                    final int rescaledBitmapHeight = (int) (0.5f + bitmapSize.y / sampleSize);
                    final int rescaledBitmapWidth = (int) Math.ceil(bitmapSize.x / sampleSize);
                    final int rescaledBitmapHeight = (int) Math.ceil(bitmapSize.y / sampleSize);
                    Bitmap cropped = ImageDecoder.decodeBitmap(srcData, (decoder, info, src) -> {
                        if (!multiCrop()) decoder.setTargetSampleSize(finalScale);
                        if (multiCrop()) {
+2 −2
Original line number Diff line number Diff line
@@ -2380,8 +2380,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
            SparseArray<Rect> relativeSuggestedCrops =
                    mWallpaperCropper.getRelativeCropHints(wallpaper);
            Point croppedBitmapSize = new Point(
                    (int) (0.5f + wallpaper.cropHint.width() / wallpaper.mSampleSize),
                    (int) (0.5f + wallpaper.cropHint.height() / wallpaper.mSampleSize));
                    (int) Math.ceil(wallpaper.cropHint.width() / wallpaper.mSampleSize),
                    (int) Math.ceil(wallpaper.cropHint.height() / wallpaper.mSampleSize));
            if (croppedBitmapSize.equals(0, 0)) {
                // There is an ImageWallpaper, but there are no crop hints and the bitmap size is
                // unknown (e.g. the default wallpaper). Return a special "null" value that will be