Loading core/java/android/view/ViewGroup.java +8 −42 Original line number Original line Diff line number Diff line Loading @@ -5357,9 +5357,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager void offsetRectBetweenParentAndChild(View descendant, Rect rect, void offsetRectBetweenParentAndChild(View descendant, Rect rect, boolean offsetFromChildToParent, boolean clipToBounds) { boolean offsetFromChildToParent, boolean clipToBounds) { final RectF rectF = mAttachInfo != null ? mAttachInfo.mTmpTransformRect1 : new RectF(); final Matrix inverse = mAttachInfo != null ? mAttachInfo.mTmpMatrix : new Matrix(); // already in the same coord system :) // already in the same coord system :) if (descendant == this) { if (descendant == this) { return; return; Loading @@ -5373,16 +5370,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager && (theParent != this)) { && (theParent != this)) { if (offsetFromChildToParent) { if (offsetFromChildToParent) { rect.offset(-descendant.mScrollX, -descendant.mScrollY); rect.offset(descendant.mLeft - descendant.mScrollX, descendant.mTop - descendant.mScrollY); if (!descendant.hasIdentityMatrix()) { rectF.set(rect); descendant.getMatrix().mapRect(rectF); rectF.roundOut(rect); } rect.offset(descendant.mLeft, descendant.mTop); if (clipToBounds) { if (clipToBounds) { View p = (View) theParent; View p = (View) theParent; boolean intersected = rect.intersect(0, 0, p.mRight - p.mLeft, boolean intersected = rect.intersect(0, 0, p.mRight - p.mLeft, Loading @@ -5400,16 +5389,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager rect.setEmpty(); rect.setEmpty(); } } } } rect.offset(-descendant.mLeft, -descendant.mTop); rect.offset(descendant.mScrollX - descendant.mLeft, descendant.mScrollY - descendant.mTop); if (!descendant.hasIdentityMatrix()) { descendant.getMatrix().invert(inverse); rectF.set(rect); inverse.mapRect(rectF); rectF.roundOut(rect); } rect.offset(descendant.mScrollX, descendant.mScrollY); } } descendant = (View) theParent; descendant = (View) theParent; Loading @@ -5420,26 +5401,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager // to get into our coordinate space // to get into our coordinate space if (theParent == this) { if (theParent == this) { if (offsetFromChildToParent) { if (offsetFromChildToParent) { rect.offset(-descendant.mScrollX, -descendant.mScrollY); rect.offset(descendant.mLeft - descendant.mScrollX, descendant.mTop - descendant.mScrollY); if (!descendant.hasIdentityMatrix()) { rectF.set(rect); descendant.getMatrix().mapRect(rectF); rectF.roundOut(rect); } rect.offset(descendant.mLeft, descendant.mTop); } else { } else { rect.offset(-descendant.mLeft, -descendant.mTop); rect.offset(descendant.mScrollX - descendant.mLeft, descendant.mScrollY - descendant.mTop); if (!descendant.hasIdentityMatrix()) { descendant.getMatrix().invert(inverse); rectF.set(rect); inverse.mapRect(rectF); rectF.roundOut(rect); } rect.offset(descendant.mScrollX, descendant.mScrollY); } } } else { } else { throw new IllegalArgumentException("parameter must be a descendant of this view"); throw new IllegalArgumentException("parameter must be a descendant of this view"); Loading Loading
core/java/android/view/ViewGroup.java +8 −42 Original line number Original line Diff line number Diff line Loading @@ -5357,9 +5357,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager void offsetRectBetweenParentAndChild(View descendant, Rect rect, void offsetRectBetweenParentAndChild(View descendant, Rect rect, boolean offsetFromChildToParent, boolean clipToBounds) { boolean offsetFromChildToParent, boolean clipToBounds) { final RectF rectF = mAttachInfo != null ? mAttachInfo.mTmpTransformRect1 : new RectF(); final Matrix inverse = mAttachInfo != null ? mAttachInfo.mTmpMatrix : new Matrix(); // already in the same coord system :) // already in the same coord system :) if (descendant == this) { if (descendant == this) { return; return; Loading @@ -5373,16 +5370,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager && (theParent != this)) { && (theParent != this)) { if (offsetFromChildToParent) { if (offsetFromChildToParent) { rect.offset(-descendant.mScrollX, -descendant.mScrollY); rect.offset(descendant.mLeft - descendant.mScrollX, descendant.mTop - descendant.mScrollY); if (!descendant.hasIdentityMatrix()) { rectF.set(rect); descendant.getMatrix().mapRect(rectF); rectF.roundOut(rect); } rect.offset(descendant.mLeft, descendant.mTop); if (clipToBounds) { if (clipToBounds) { View p = (View) theParent; View p = (View) theParent; boolean intersected = rect.intersect(0, 0, p.mRight - p.mLeft, boolean intersected = rect.intersect(0, 0, p.mRight - p.mLeft, Loading @@ -5400,16 +5389,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager rect.setEmpty(); rect.setEmpty(); } } } } rect.offset(-descendant.mLeft, -descendant.mTop); rect.offset(descendant.mScrollX - descendant.mLeft, descendant.mScrollY - descendant.mTop); if (!descendant.hasIdentityMatrix()) { descendant.getMatrix().invert(inverse); rectF.set(rect); inverse.mapRect(rectF); rectF.roundOut(rect); } rect.offset(descendant.mScrollX, descendant.mScrollY); } } descendant = (View) theParent; descendant = (View) theParent; Loading @@ -5420,26 +5401,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager // to get into our coordinate space // to get into our coordinate space if (theParent == this) { if (theParent == this) { if (offsetFromChildToParent) { if (offsetFromChildToParent) { rect.offset(-descendant.mScrollX, -descendant.mScrollY); rect.offset(descendant.mLeft - descendant.mScrollX, descendant.mTop - descendant.mScrollY); if (!descendant.hasIdentityMatrix()) { rectF.set(rect); descendant.getMatrix().mapRect(rectF); rectF.roundOut(rect); } rect.offset(descendant.mLeft, descendant.mTop); } else { } else { rect.offset(-descendant.mLeft, -descendant.mTop); rect.offset(descendant.mScrollX - descendant.mLeft, descendant.mScrollY - descendant.mTop); if (!descendant.hasIdentityMatrix()) { descendant.getMatrix().invert(inverse); rectF.set(rect); inverse.mapRect(rectF); rectF.roundOut(rect); } rect.offset(descendant.mScrollX, descendant.mScrollY); } } } else { } else { throw new IllegalArgumentException("parameter must be a descendant of this view"); throw new IllegalArgumentException("parameter must be a descendant of this view"); Loading