diff options
author | Gilles Debunne <debunne@google.com> | 2011-10-28 20:44:17 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-10-28 20:44:17 +0000 |
commit | a068e2f1d9532e6f005a162adfa295c553873ca5 (patch) | |
tree | 252b8f24c58e8388ee111bc4f82d6ac215ccdf17 /core | |
parent | 58ba1b6121a9f11bc1ba40eb5b267033bbf2fafb (diff) | |
parent | 4eec98edee3d6eb516e30a7151da13fd726f93a9 (diff) | |
download | frameworks_base-a068e2f1d9532e6f005a162adfa295c553873ca5.zip frameworks_base-a068e2f1d9532e6f005a162adfa295c553873ca5.tar.gz frameworks_base-a068e2f1d9532e6f005a162adfa295c553873ca5.tar.bz2 |
am 4eec98ed: Merge "Text handles do not handle scroll correctly" into ics-mr0
* commit '4eec98edee3d6eb516e30a7151da13fd726f93a9':
Text handles do not handle scroll correctly
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/widget/TextView.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 5a300e8..9257534 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -9484,8 +9484,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return false; } - int posX = mPositionX + positionX - getScrollX(); - int posY = mPositionY + positionY - getScrollY(); + int posX = mPositionX + positionX; + int posY = mPositionY + positionY; // Offset by 1 to take into account 0.5 and int rounding around getPrimaryHorizontal. return posX >= clip.left - 1 && posX <= clip.right + 1 && @@ -9496,7 +9496,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener final int line = mLayout.getLineForOffset(offset); final int lineBottom = mLayout.getLineBottom(line); final int primaryHorizontal = (int) mLayout.getPrimaryHorizontal(offset); - return isVisible(primaryHorizontal, lineBottom); + return isVisible(primaryHorizontal + viewportToContentHorizontalOffset(), + lineBottom + viewportToContentVerticalOffset()); } public void onScrollChanged() { @@ -10643,7 +10644,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mPositionX = (int) (mLayout.getPrimaryHorizontal(offset) - 0.5f - mHotspotX); mPositionY = mLayout.getLineBottom(line); - // Take TextView's padding into account. + // Take TextView's padding and scroll into account. mPositionX += viewportToContentHorizontalOffset(); mPositionY += viewportToContentVerticalOffset(); |