summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hyunyoung Song <hyunyoungs@google.com> 2016-03-10 02:22:56 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-03-10 02:22:58 +0000
commitef33726e1439adeb408b0ca44f0ee55042dad26d (patch)
tree6faf11b5440a9630452a1e972a71c1bc73e22908
parent44ffd922dc61e0855026763b8d53453f0a1eda17 (diff)
parent4eb1a4e003fd7be99346b19773775417df067a73 (diff)
Merge "Revert "Apply transformations while offsetting focused rects"" into nyc-dev
-rw-r--r--core/java/android/view/ViewGroup.java50
1 files changed, 8 insertions, 42 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index c54ce80631bd..d29bc21ce60b 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -5357,9 +5357,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
void offsetRectBetweenParentAndChild(View descendant, Rect rect,
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 :)
if (descendant == this) {
return;
@@ -5373,16 +5370,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
&& (theParent != this)) {
if (offsetFromChildToParent) {
- rect.offset(-descendant.mScrollX, -descendant.mScrollY);
-
- if (!descendant.hasIdentityMatrix()) {
- rectF.set(rect);
- descendant.getMatrix().mapRect(rectF);
- rectF.roundOut(rect);
- }
-
- rect.offset(descendant.mLeft, descendant.mTop);
-
+ rect.offset(descendant.mLeft - descendant.mScrollX,
+ descendant.mTop - descendant.mScrollY);
if (clipToBounds) {
View p = (View) theParent;
boolean intersected = rect.intersect(0, 0, p.mRight - p.mLeft,
@@ -5400,16 +5389,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
rect.setEmpty();
}
}
- rect.offset(-descendant.mLeft, -descendant.mTop);
-
- if (!descendant.hasIdentityMatrix()) {
- descendant.getMatrix().invert(inverse);
- rectF.set(rect);
- inverse.mapRect(rectF);
- rectF.roundOut(rect);
- }
-
- rect.offset(descendant.mScrollX, descendant.mScrollY);
+ rect.offset(descendant.mScrollX - descendant.mLeft,
+ descendant.mScrollY - descendant.mTop);
}
descendant = (View) theParent;
@@ -5420,26 +5401,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
// to get into our coordinate space
if (theParent == this) {
if (offsetFromChildToParent) {
- rect.offset(-descendant.mScrollX, -descendant.mScrollY);
-
- if (!descendant.hasIdentityMatrix()) {
- rectF.set(rect);
- descendant.getMatrix().mapRect(rectF);
- rectF.roundOut(rect);
- }
-
- rect.offset(descendant.mLeft, descendant.mTop);
+ rect.offset(descendant.mLeft - descendant.mScrollX,
+ descendant.mTop - descendant.mScrollY);
} else {
- rect.offset(-descendant.mLeft, -descendant.mTop);
-
- if (!descendant.hasIdentityMatrix()) {
- descendant.getMatrix().invert(inverse);
- rectF.set(rect);
- inverse.mapRect(rectF);
- rectF.roundOut(rect);
- }
-
- rect.offset(descendant.mScrollX, descendant.mScrollY);
+ rect.offset(descendant.mScrollX - descendant.mLeft,
+ descendant.mScrollY - descendant.mTop);
}
} else {
throw new IllegalArgumentException("parameter must be a descendant of this view");