From 03876c905f3874f3ac8deb5a23ee0f77d4c04bab Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Sat, 2 Oct 2010 17:28:29 -0700 Subject: Fix text anchor fade-out positioning Change-Id: I5660481fb883c28c88e384be2f26e67aa854ec8e --- core/java/android/widget/TextView.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index e902dbaedec9..72df726b737a 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -7720,19 +7720,18 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener final int compoundPaddingRight = getCompoundPaddingRight(); final TextView hostView = TextView.this; - final int handleWidth = mDrawable.getIntrinsicWidth(); final int left = 0; final int right = hostView.getWidth(); final int top = 0; final int bottom = hostView.getHeight(); - final int clipLeft = left + compoundPaddingLeft - (int) (handleWidth * 0.75f); + final int clipLeft = left + compoundPaddingLeft; final int clipTop = top + extendedPaddingTop; - final int clipRight = right - compoundPaddingRight + (int) (handleWidth * 0.25f); + final int clipRight = right - compoundPaddingRight; final int clipBottom = bottom - extendedPaddingBottom; - return mPositionX >= clipLeft && mPositionX <= clipRight && - mPositionY >= clipTop && mPositionY <= clipBottom; + return mPositionX + mHotspotX >= clipLeft && mPositionX + mHotspotX <= clipRight && + mPositionY + mHotspotY >= clipTop && mPositionY + mHotspotY <= clipBottom; } private void moveTo(int x, int y) { -- cgit v1.2.3-59-g8ed1b