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

Commit 8d79feb8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix magnification viewport drifting when scaling"

parents 8147093f 10280a87
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -446,8 +446,10 @@ class MagnificationController implements Handler.Callback {
            mMagnificationRegion.getBounds(viewport);
            final MagnificationSpec spec = mCurrentMagnificationSpec;
            final float oldScale = spec.scale;
            final float oldCenterX = (viewport.width() / 2.0f - spec.offsetX) / oldScale;
            final float oldCenterY = (viewport.height() / 2.0f - spec.offsetY) / oldScale;
            final float oldCenterX
                    = (viewport.width() / 2.0f - spec.offsetX + viewport.left) / oldScale;
            final float oldCenterY
                    = (viewport.height() / 2.0f - spec.offsetY + viewport.top) / oldScale;
            final float normPivotX = (pivotX - spec.offsetX) / oldScale;
            final float normPivotY = (pivotY - spec.offsetY) / oldScale;
            final float offsetX = (oldCenterX - normPivotX) * (oldScale / scale);