diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 25a70eb0ecf2b..b22c187e89573 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -825,6 +825,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager return false; } + // Clip the bounds by our bounds. + bounds.left = Math.max(bounds.left, 0); + bounds.top = Math.max(bounds.top, 0); + bounds.right = Math.min(bounds.right, mRight); + bounds.bottom = Math.min(bounds.bottom, mBottom); + Iterator iterator = obtainOrderedChildIterator(); while (iterator.hasNext()) { View sibling = iterator.next();