Loading core/java/android/view/View.java +23 −0 Original line number Diff line number Diff line Loading @@ -27376,6 +27376,29 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } /** * Modifiers the input matrix such that it maps root view's coordinates to view-local * coordinates. * * @param matrix input matrix to modify * @hide */ public void transformMatrixRootToLocal(@NonNull Matrix matrix) { final ViewParent parent = mParent; if (parent instanceof final View vp) { vp.transformMatrixRootToLocal(matrix); matrix.postTranslate(vp.mScrollX, vp.mScrollY); } // This method is different from transformMatrixToLocal that it doesn't perform any // transformation for ViewRootImpl matrix.postTranslate(-mLeft, -mTop); if (!hasIdentityMatrix()) { matrix.postConcat(getInverseMatrix()); } } /** * @hide */ core/java/android/widget/TextView.java +1 −1 Original line number Diff line number Diff line Loading @@ -14375,7 +14375,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener Matrix matrix = mTempMatrix; matrix.reset(); transformMatrixToLocal(matrix); transformMatrixRootToLocal(matrix); editorBounds.set(rect); // When the view has transformations like scaleX/scaleY computing the global visible // rectangle will already apply the transformations. The getLocalVisibleRect only offsets Loading
core/java/android/view/View.java +23 −0 Original line number Diff line number Diff line Loading @@ -27376,6 +27376,29 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } /** * Modifiers the input matrix such that it maps root view's coordinates to view-local * coordinates. * * @param matrix input matrix to modify * @hide */ public void transformMatrixRootToLocal(@NonNull Matrix matrix) { final ViewParent parent = mParent; if (parent instanceof final View vp) { vp.transformMatrixRootToLocal(matrix); matrix.postTranslate(vp.mScrollX, vp.mScrollY); } // This method is different from transformMatrixToLocal that it doesn't perform any // transformation for ViewRootImpl matrix.postTranslate(-mLeft, -mTop); if (!hasIdentityMatrix()) { matrix.postConcat(getInverseMatrix()); } } /** * @hide */
core/java/android/widget/TextView.java +1 −1 Original line number Diff line number Diff line Loading @@ -14375,7 +14375,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener Matrix matrix = mTempMatrix; matrix.reset(); transformMatrixToLocal(matrix); transformMatrixRootToLocal(matrix); editorBounds.set(rect); // When the view has transformations like scaleX/scaleY computing the global visible // rectangle will already apply the transformations. The getLocalVisibleRect only offsets