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

Commit 8b3b6386 authored by Rob Carr's avatar Rob Carr Committed by Automerger Merge Worker
Browse files

Merge "WindowState: Correct wallpaper scaling" into sc-dev am: e7fc7576

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15006781

Change-Id: I257275c06a6b41d8cd509548c668494d4b93e24a
parents a736d913 e7fc7576
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -5512,7 +5512,19 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        mSurfacePlacementNeeded = false;
        transformFrameToSurfacePosition(mWindowFrames.mFrame.left, mWindowFrames.mFrame.top,
                mSurfacePosition);

        if (mWallpaperScale != 1f) {
            DisplayInfo displayInfo = getDisplayInfo();
            Matrix matrix = mTmpMatrix;
            matrix.setTranslate(mXOffset, mYOffset);
            matrix.postScale(mWallpaperScale, mWallpaperScale, displayInfo.logicalWidth / 2f,
                displayInfo.logicalHeight / 2f);
            matrix.getValues(mTmpMatrixArray);
            mSurfacePosition.offset(Math.round(mTmpMatrixArray[Matrix.MTRANS_X]),
                Math.round(mTmpMatrixArray[Matrix.MTRANS_Y]));
        } else {
            mSurfacePosition.offset(mXOffset, mYOffset);
        }

        // Freeze position while we're unrotated, so the surface remains at the position it was
        // prior to the rotation.