Loading core/java/android/widget/TextView.java +8 −6 Original line number Diff line number Diff line Loading @@ -5017,9 +5017,15 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return (int) Math.max(0, mShadowDy + mShadowRadius); } private int getFudgedPaddingRight() { // Add sufficient space for cursor and tone marks int cursorWidth = 2 + (int)mTextPaint.density; // adequate for Material cursors return Math.max(0, getCompoundPaddingRight() - (cursorWidth - 1)); } @Override protected int getRightPaddingOffset() { return -(getCompoundPaddingRight() - mPaddingRight) + return -(getFudgedPaddingRight() - mPaddingRight) + (int) Math.max(0, mShadowDx + mShadowRadius); } Loading Loading @@ -5373,13 +5379,9 @@ 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 - fudgedPaddingRight + scrollX; float clipRight = right - left - getFudgedPaddingRight() + scrollX; float clipBottom = bottom - top + scrollY - ((scrollY == maxScrollY) ? 0 : extendedPaddingBottom); Loading Loading
core/java/android/widget/TextView.java +8 −6 Original line number Diff line number Diff line Loading @@ -5017,9 +5017,15 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return (int) Math.max(0, mShadowDy + mShadowRadius); } private int getFudgedPaddingRight() { // Add sufficient space for cursor and tone marks int cursorWidth = 2 + (int)mTextPaint.density; // adequate for Material cursors return Math.max(0, getCompoundPaddingRight() - (cursorWidth - 1)); } @Override protected int getRightPaddingOffset() { return -(getCompoundPaddingRight() - mPaddingRight) + return -(getFudgedPaddingRight() - mPaddingRight) + (int) Math.max(0, mShadowDx + mShadowRadius); } Loading Loading @@ -5373,13 +5379,9 @@ 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 - fudgedPaddingRight + scrollX; float clipRight = right - left - getFudgedPaddingRight() + scrollX; float clipBottom = bottom - top + scrollY - ((scrollY == maxScrollY) ? 0 : extendedPaddingBottom); Loading