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

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

Merge "Fix a11y text location in clipped views" into oc-dev

parents 82629345 cdc74590
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -10264,16 +10264,14 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                    positionInfoStartIndex + positionInfoLength,
                    viewportToContentHorizontalOffset(), viewportToContentVerticalOffset());
            CursorAnchorInfo cursorAnchorInfo = builder.setMatrix(null).build();
            if (mTempRect == null) mTempRect = new Rect();
            Rect viewBoundsInScreen = mTempRect;
            info.getBoundsInScreen(viewBoundsInScreen);
            int[] locationOnScreen = getLocationOnScreen();
            for (int i = 0; i < positionInfoLength; i++) {
                int flags = cursorAnchorInfo.getCharacterBoundsFlags(positionInfoStartIndex + i);
                if ((flags & FLAG_HAS_VISIBLE_REGION) == FLAG_HAS_VISIBLE_REGION) {
                    RectF bounds = cursorAnchorInfo
                            .getCharacterBounds(positionInfoStartIndex + i);
                    if (bounds != null) {
                        bounds.offset(viewBoundsInScreen.left, viewBoundsInScreen.top);
                        bounds.offset(locationOnScreen[0], locationOnScreen[1]);
                        boundingRects[i] = bounds;
                    }
                }