Merge "Fix some drawing artifacts/bugs around overlays/text anchors" into gingerbread

This commit is contained in:
Adam Powell
2010-09-17 19:15:38 -07:00
committed by Android (Google) Code Review
2 changed files with 13 additions and 5 deletions

View File

@@ -3542,10 +3542,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
for (int i = 0; i < childCount; i++) {
final View child = getChildAt(i);
if (child.isOverlayEnabled()) {
canvas.translate(child.mLeft + child.mScrollX, child.mTop + child.mScrollY);
canvas.translate(child.mLeft - child.mScrollX, child.mTop - child.mScrollY);
child.onDrawOverlay(canvas);
canvas.translate(-(child.mLeft + child.mScrollX),
-(child.mTop + child.mScrollY));
canvas.translate(-(child.mLeft - child.mScrollX),
-(child.mTop - child.mScrollY));
}
}
}

View File

@@ -7727,8 +7727,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
bounds.bottom = bounds.top + drawableHeight;
convertFromViewportToContentCoordinates(bounds);
invalidate();
mDrawable.setBounds(bounds);
postInvalidate();
invalidate();
}
boolean hasFingerOn(float x, float y) {
@@ -7745,9 +7746,16 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
return Rect.intersects(mDrawable.getBounds(), fingerRect);
}
void invalidate() {
final Rect bounds = mDrawable.getBounds();
TextView.this.invalidate(bounds.left, bounds.top,
bounds.right, bounds.bottom);
}
void postInvalidate() {
final Rect bounds = mDrawable.getBounds();
TextView.this.postInvalidate(bounds.left, bounds.top, bounds.right, bounds.bottom);
TextView.this.postInvalidate(bounds.left, bounds.top,
bounds.right, bounds.bottom);
}
void postInvalidateDelayed(long delay) {