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

Commit 25b8a80d authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Fix screenshot scaling bug" into rvc-dev am: 91ae0d0d am: b953d840

Change-Id: Ia4ea5301403fc2bcf56be52f57c241346b69b0c8
parents d4fe3af3 b953d840
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -514,12 +514,17 @@ public class GlobalScreenshot implements ViewTreeObserver.OnComputeInternalInset
                        1, cornerScale, mFastOutSlowIn.getInterpolation(t / scalePct));
                        1, cornerScale, mFastOutSlowIn.getInterpolation(t / scalePct));
                mScreenshotView.setScaleX(scale);
                mScreenshotView.setScaleX(scale);
                mScreenshotView.setScaleY(scale);
                mScreenshotView.setScaleY(scale);
            } else {
                mScreenshotView.setScaleX(cornerScale);
                mScreenshotView.setScaleY(cornerScale);
            }
            }


            if (t < xPositionPct) {
            if (t < xPositionPct) {
                float xCenter = MathUtils.lerp(startPos.x, finalPos.x,
                float xCenter = MathUtils.lerp(startPos.x, finalPos.x,
                        mFastOutSlowIn.getInterpolation(t / xPositionPct));
                        mFastOutSlowIn.getInterpolation(t / xPositionPct));
                mScreenshotView.setX(xCenter - width * mScreenshotView.getScaleX() / 2f);
                mScreenshotView.setX(xCenter - width * mScreenshotView.getScaleX() / 2f);
            } else {
                mScreenshotView.setX(finalPos.x - width * mScreenshotView.getScaleX() / 2f);
            }
            }
            float yCenter = MathUtils.lerp(startPos.y, finalPos.y,
            float yCenter = MathUtils.lerp(startPos.y, finalPos.y,
                    mFastOutSlowIn.getInterpolation(t));
                    mFastOutSlowIn.getInterpolation(t));
@@ -544,6 +549,10 @@ public class GlobalScreenshot implements ViewTreeObserver.OnComputeInternalInset
            @Override
            @Override
            public void onAnimationEnd(Animator animation) {
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                super.onAnimationEnd(animation);
                mScreenshotView.setScaleX(cornerScale);
                mScreenshotView.setScaleY(cornerScale);
                mScreenshotView.setX(finalPos.x - height * cornerScale / 2f);
                mScreenshotView.setY(finalPos.y - height * cornerScale / 2f);
                Rect bounds = new Rect();
                Rect bounds = new Rect();
                mScreenshotView.getBoundsOnScreen(bounds);
                mScreenshotView.getBoundsOnScreen(bounds);
                mDismissButton.setX(bounds.right - mDismissButtonSize / 2f);
                mDismissButton.setX(bounds.right - mDismissButtonSize / 2f);