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

Commit cb11f8a2 authored by Chong Zhang's avatar Chong Zhang Committed by Android (Google) Code Review
Browse files

Merge "Fix rect convert from screen to surface coordinates with scaling"

parents f56a60fa 84389571
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2284,10 +2284,12 @@ final class WindowState implements WindowManagerPolicy.WindowState {

    void transformFromScreenToSurfaceSpace(Rect rect) {
         if (mHScale >= 0) {
            rect.right = rect.left + (int)((rect.right - rect.left) / mHScale);
            rect.left = (int) (rect.left / mHScale);
            rect.right = (int) (rect.right / mHScale);
        }
        if (mVScale >= 0) {
            rect.bottom = rect.top + (int)((rect.bottom - rect.top) / mVScale);
            rect.top = (int) (rect.top / mVScale);
            rect.bottom = (int) (rect.bottom / mVScale);
        }
    }