From 14b2b74c13d0a22b396d10601bd683d80378810a Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Tue, 8 May 2012 16:36:34 -0700 Subject: [PATCH] Fixing View.getBoundsOnScreen() 1. The function was not setting the initial rect properly. bug:6462629 Change-Id: I7a832a979576fc5745794c68fb8414257efb21dd --- core/java/android/view/View.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 2befccea488d8..9fa67acf62a7d 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -4676,13 +4676,13 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal } RectF position = mAttachInfo.mTmpTransformRect; - position.setEmpty(); + position.set(0, 0, mRight - mLeft, mBottom - mTop); if (!hasIdentityMatrix()) { getMatrix().mapRect(position); } - position.offset(mLeft, mRight); + position.offset(mLeft, mTop); ViewParent parent = mParent; while (parent instanceof View) {