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

* commit 'cda81f2ded39b53dd813071760ad235363292d52':
  Fudge clipRect in TextView for extra cursor width
This commit is contained in:
Raph Levien
2014-11-14 20:56:35 +00:00
committed by Android Git Automerger

View File

@@ -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);