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

Commit 3f5a6d14 authored by Phil Weaver's avatar Phil Weaver Committed by android-build-merger
Browse files

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

am: 6a603221

Change-Id: Ia0bc461e0d7e1c4b5a10952c3a52b314a6a22379
parents e0685392 6a603221
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;
                    }
                }