Have ViewGroups without a parent clip child visible rects to bounds
getChildVisibleRect was enhanced to obey the official contracts for clipping children and clip to padding. Unfortunately this meant that ViewGroups with no parent have no way of checking if they will be clipped to their own bounds and therefore should clip a child rect. Treat orphaned view subtrees as entities that clip to the root view bounds to preserve prior CTS guarantees. Bug 18642973 Change-Id: I9fcbeb0e92cd6715cd9184183d36889614ed0bed
This commit is contained in:
@@ -5113,7 +5113,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
|
||||
final int height = mBottom - mTop;
|
||||
|
||||
boolean rectIsVisible = true;
|
||||
if (mParent instanceof ViewGroup && ((ViewGroup)mParent).getClipChildren()) {
|
||||
if (mParent == null ||
|
||||
(mParent instanceof ViewGroup && ((ViewGroup) mParent).getClipChildren())) {
|
||||
// Clip to bounds.
|
||||
rectIsVisible = rect.intersect(0, 0, width, height);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user