@@ -9484,8 +9484,8 @@ public boolean isVisible(int positionX, int positionY) {
94849484 return false ;
94859485 }
94869486
9487- int posX = mPositionX + positionX - getScrollX () ;
9488- int posY = mPositionY + positionY - getScrollY () ;
9487+ int posX = mPositionX + positionX ;
9488+ int posY = mPositionY + positionY ;
94899489
94909490 // Offset by 1 to take into account 0.5 and int rounding around getPrimaryHorizontal.
94919491 return posX >= clip .left - 1 && posX <= clip .right + 1 &&
@@ -9496,7 +9496,8 @@ public boolean isOffsetVisible(int offset) {
94969496 final int line = mLayout .getLineForOffset (offset );
94979497 final int lineBottom = mLayout .getLineBottom (line );
94989498 final int primaryHorizontal = (int ) mLayout .getPrimaryHorizontal (offset );
9499- return isVisible (primaryHorizontal , lineBottom );
9499+ return isVisible (primaryHorizontal + viewportToContentHorizontalOffset (),
9500+ lineBottom + viewportToContentVerticalOffset ());
95009501 }
95019502
95029503 public void onScrollChanged () {
@@ -10643,7 +10644,7 @@ protected void positionAtCursorOffset(int offset, boolean parentScrolled) {
1064310644 mPositionX = (int ) (mLayout .getPrimaryHorizontal (offset ) - 0.5f - mHotspotX );
1064410645 mPositionY = mLayout .getLineBottom (line );
1064510646
10646- // Take TextView's padding into account.
10647+ // Take TextView's padding and scroll into account.
1064710648 mPositionX += viewportToContentHorizontalOffset ();
1064810649 mPositionY += viewportToContentVerticalOffset ();
1064910650
0 commit comments