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

Commit 9848c84d authored by Robert Carr's avatar Robert Carr
Browse files

Fix surfaceInset adjustment.

surfaceInsets are relative and have the same
sign direction for left/top/right/bottom. This means
we want to subtract the left/top insets and add the
right/bottom in order to expand the surface. The current code
is adding the left/right insets before adding them to the right,
while still subtracting from the left. This ends up expanding the
surface by 3*inset pixels instead of 2*inset pixels.

Bug: 28368990
Change-Id: I6495e39283c7d2494c962f89e95672c5f1f6e1cd
parent 97ef0e77
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -820,8 +820,8 @@ class WindowStateAnimator {
        // Adjust for surface insets.
        mTmpSize.left -= scale * attrs.surfaceInsets.left;
        mTmpSize.top -= scale * attrs.surfaceInsets.top;
        mTmpSize.right += scale * (attrs.surfaceInsets.left + attrs.surfaceInsets.right);
        mTmpSize.bottom += scale * (attrs.surfaceInsets.top + attrs.surfaceInsets.bottom);
        mTmpSize.right += scale * attrs.surfaceInsets.right;
        mTmpSize.bottom += scale * attrs.surfaceInsets.bottom;
    }

    boolean hasSurface() {