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

Commit 85dfb5e3 authored by Haoyu Zhang's avatar Haoyu Zhang
Browse files

Fix: EditText returns wrong CursorAnchorInfo matrix

Bug: 245025737
Test: tested manually
Change-Id: Ia8b0b25582cc89b5729cebc27426f54bc3d8007d
parent 77689d19
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -4587,7 +4587,6 @@ public class Editor {
     */
    private final class CursorAnchorInfoNotifier implements TextViewPositionListener {
        final CursorAnchorInfo.Builder mSelectionInfoBuilder = new CursorAnchorInfo.Builder();
        final int[] mTmpIntOffset = new int[2];
        final Matrix mViewToScreenMatrix = new Matrix();

        @Override
@@ -4635,9 +4634,8 @@ public class Editor {
            builder.setSelectionRange(selectionStart, mTextView.getSelectionEnd());

            // Construct transformation matrix from view local coordinates to screen coordinates.
            mViewToScreenMatrix.set(mTextView.getMatrix());
            mTextView.getLocationOnScreen(mTmpIntOffset);
            mViewToScreenMatrix.postTranslate(mTmpIntOffset[0], mTmpIntOffset[1]);
            mViewToScreenMatrix.reset();
            mTextView.transformMatrixToGlobal(mViewToScreenMatrix);
            builder.setMatrix(mViewToScreenMatrix);

            if (includeEditorBounds) {