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

Commit 0ea0273c authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Makes sure the magnifier source bounds doesn't beyond the surface."...

Merge "Makes sure the magnifier source bounds doesn't beyond the surface." into rvc-dev am: 2c591e8c

Change-Id: I9758995b034bb99545cddf29359207407b3907c6
parents 4024b069 2c591e8c
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -353,8 +353,9 @@ public final class Magnifier {


            // Gets the startX for new style, which should be bounded by the horizontal bounds.
            // Gets the startX for new style, which should be bounded by the horizontal bounds.
            // Also calculates the left/right cut width for pixel copy.
            // Also calculates the left/right cut width for pixel copy.
            leftBound += mViewCoordinatesInSurface[0];
            leftBound = Math.max(leftBound + mViewCoordinatesInSurface[0], 0);
            rightBound += mViewCoordinatesInSurface[0];
            rightBound = Math.min(
                rightBound + mViewCoordinatesInSurface[0], mContentCopySurface.mWidth);
            mLeftCutWidth = Math.max(0, leftBound - startX);
            mLeftCutWidth = Math.max(0, leftBound - startX);
            mRightCutWidth = Math.max(0, startX + mSourceWidth - rightBound);
            mRightCutWidth = Math.max(0, startX + mSourceWidth - rightBound);
            startX = Math.max(startX, leftBound);
            startX = Math.max(startX, leftBound);