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

Commit 2d208505 authored by Raph Levien's avatar Raph Levien Committed by android-build-merger
Browse files

am cda81f2d: Merge "Fudge clipRect in TextView for extra cursor width" into lmp-mr1-dev

automerge: be1ad50b

* commit 'be1ad50b':
  Fudge clipRect in TextView for extra cursor width
parents b536c7a6 be1ad50b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -5369,9 +5369,13 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        final int vspace = mBottom - mTop - compoundPaddingBottom - compoundPaddingTop;
        final int maxScrollY = mLayout.getHeight() - vspace;

        // Add sufficient space for cursor and tone marks
        int cursorWidth = 2 + (int)mTextPaint.density; // adequate for Material cursors
        int fudgedPaddingRight = Math.max(0, compoundPaddingRight - (cursorWidth - 1));

        float clipLeft = compoundPaddingLeft + scrollX;
        float clipTop = (scrollY == 0) ? 0 : extendedPaddingTop + scrollY;
        float clipRight = right - left - compoundPaddingRight + scrollX;
        float clipRight = right - left - fudgedPaddingRight + scrollX;
        float clipBottom = bottom - top + scrollY -
                ((scrollY == maxScrollY) ? 0 : extendedPaddingBottom);