@@ -9409,8 +9409,8 @@ public boolean isVisible(int positionX, int positionY) {
94099409 return false ;
94109410 }
94119411
9412- int posX = mPositionX + positionX - getScrollX () ;
9413- int posY = mPositionY + positionY - getScrollY () ;
9412+ int posX = mPositionX + positionX ;
9413+ int posY = mPositionY + positionY ;
94149414
94159415 // Offset by 1 to take into account 0.5 and int rounding around getPrimaryHorizontal.
94169416 return posX >= clip .left - 1 && posX <= clip .right + 1 &&
@@ -9421,7 +9421,8 @@ public boolean isOffsetVisible(int offset) {
94219421 final int line = mLayout .getLineForOffset (offset );
94229422 final int lineBottom = mLayout .getLineBottom (line );
94239423 final int primaryHorizontal = (int ) mLayout .getPrimaryHorizontal (offset );
9424- return isVisible (primaryHorizontal , lineBottom );
9424+ return isVisible (primaryHorizontal + viewportToContentHorizontalOffset (),
9425+ lineBottom + viewportToContentVerticalOffset ());
94259426 }
94269427
94279428 public void onScrollChanged () {
@@ -10561,7 +10562,7 @@ protected void positionAtCursorOffset(int offset, boolean parentScrolled) {
1056110562 mPositionX = (int ) (mLayout .getPrimaryHorizontal (offset ) - 0.5f - mHotspotX );
1056210563 mPositionY = mLayout .getLineBottom (line );
1056310564
10564- // Take TextView's padding into account.
10565+ // Take TextView's padding and scroll into account.
1056510566 mPositionX += viewportToContentHorizontalOffset ();
1056610567 mPositionY += viewportToContentVerticalOffset ();
1056710568
0 commit comments