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

Commit 4d2bd4c9 authored by Michael Jurka's avatar Michael Jurka
Browse files

fixing getLocationInWindow

- takes into account mTranslationX/Y

Change-Id: I7d622fe9e8b5e021f8585894b72ffd82c087cc57
parent 7c2bacf6
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -9233,14 +9233,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
                    + "two integers");
        }

        location[0] = mLeft;
        location[1] = mTop;
        location[0] = mLeft + (int) (mTranslationX + 0.5f);
        location[1] = mTop + (int) (mTranslationY + 0.5f);

        ViewParent viewParent = mParent;
        while (viewParent instanceof View) {
            final View view = (View)viewParent;
            location[0] += view.mLeft - view.mScrollX;
            location[1] += view.mTop - view.mScrollY;
            location[0] += view.mLeft + (int) (view.mTranslationX + 0.5f) - view.mScrollX;
            location[1] += view.mTop + (int) (view.mTranslationY + 0.5f) - view.mScrollY;
            viewParent = view.mParent;
        }