diff options
| author | Raph Levien <raph@google.com> | 2014-11-14 20:51:55 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-11-14 20:51:58 +0000 |
| commit | cda81f2ded39b53dd813071760ad235363292d52 (patch) | |
| tree | b41deb094b001370ee4371ac6413e9f4a775aabe /core/java/android/widget/TextView.java | |
| parent | 27936ad3a677509fab1174c7b6655c894f018143 (diff) | |
| parent | 44cb2432e90c7a9e0ee59b959d781ba8834c1736 (diff) | |
Merge "Fudge clipRect in TextView for extra cursor width" into lmp-mr1-dev
Diffstat (limited to 'core/java/android/widget/TextView.java')
| -rw-r--r-- | core/java/android/widget/TextView.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 5e83602bc3b0..4ad75a636501 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -5370,9 +5370,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); |
