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

Commit cc595bb4 authored by Phil Weaver's avatar Phil Weaver
Browse files

Get text positions from transformed text

Using the non-transformed text is bad because the
transformed text is what's actually on the screen,
so it is the thing whose position is relevant.

Bug: 69044691
Test: Updating a11y cts test to use an all-caps
german strong s, which causes the transformed text
to be longer than the original text. That changed
test fails without this fix.

Change-Id: Ia7aac3b4322ffb48f10771f4d1b33c80ca28b120
parent 92ab9f1c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -10918,7 +10918,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            final boolean ltrLine =
                    mLayout.getParagraphDirection(line) == Layout.DIR_LEFT_TO_RIGHT;
            final float[] widths = new float[offsetEnd - offsetStart];
            mLayout.getPaint().getTextWidths(mText, offsetStart, offsetEnd, widths);
            mLayout.getPaint().getTextWidths(mTransformed, offsetStart, offsetEnd, widths);
            final float top = mLayout.getLineTop(line);
            final float bottom = mLayout.getLineBottom(line);
            for (int offset = offsetStart; offset < offsetEnd; ++offset) {