Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3db8660 authored by Chet Haase's avatar Chet Haase
Browse files

Don't constrain invalidation rect when not clipping children

View.setClipChidlren(false) allows children to draw outside of their containers.
But logic in ViewGroup.invalidateChildInParent() constrains the invalidation
rectangle to the bounds of the parent, making the flag useless in some situations.
Avoid intersecting the dirty rect with the parent bounds when the parent
is set to not clip its children.

Change-Id: Icc485b539758c96da0bd62ef57974a1bcb94f866
parent 49840e25
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -3960,7 +3960,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                final int left = mLeft;
                final int left = mLeft;
                final int top = mTop;
                final int top = mTop;


                if (dirty.intersect(0, 0, mRight - left, mBottom - top) ||
                if ((mGroupFlags & FLAG_CLIP_CHILDREN) != FLAG_CLIP_CHILDREN ||
                        dirty.intersect(0, 0, mRight - left, mBottom - top) ||
                        (mPrivateFlags & DRAW_ANIMATION) == DRAW_ANIMATION) {
                        (mPrivateFlags & DRAW_ANIMATION) == DRAW_ANIMATION) {
                    mPrivateFlags &= ~DRAWING_CACHE_VALID;
                    mPrivateFlags &= ~DRAWING_CACHE_VALID;


@@ -3978,8 +3979,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager


                location[CHILD_LEFT_INDEX] = mLeft;
                location[CHILD_LEFT_INDEX] = mLeft;
                location[CHILD_TOP_INDEX] = mTop;
                location[CHILD_TOP_INDEX] = mTop;

                if ((mGroupFlags & FLAG_CLIP_CHILDREN) == FLAG_CLIP_CHILDREN) {
                    dirty.set(0, 0, mRight - mLeft, mBottom - mTop);
                    dirty.set(0, 0, mRight - mLeft, mBottom - mTop);
                } else {
                    // in case the dirty rect extends outside the bounds of this container
                    dirty.union(0, 0, mRight - mLeft, mBottom - mTop);
                }


                if (mLayerType != LAYER_TYPE_NONE) {
                if (mLayerType != LAYER_TYPE_NONE) {
                    mLocalDirtyRect.union(dirty);
                    mLocalDirtyRect.union(dirty);