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

Commit 6583ce5b authored by Gilles Debunne's avatar Gilles Debunne
Browse files

Minor tweak in getLocationInWindow

Change-Id: Ib3f30dbfb3aee7c46c58e1f7832e3394702c0ff6
parent f9bb1cd1
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -12208,13 +12208,16 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
     * @param location an array of two integers in which to hold the coordinates
     */
    public void getLocationInWindow(int[] location) {
        // When the view is not attached to a window, this method does not make sense
        if (mAttachInfo == null) return;
        if (location == null || location.length < 2) {
            throw new IllegalArgumentException("location must be an array of two integers");
        }
        if (mAttachInfo == null) {
            // When the view is not attached to a window, this method does not make sense
            location[0] = location[1] = 0;
            return;
        }
        float[] position = mAttachInfo.mTmpTransformLocation;
        position[0] = position[1] = 0.0f;