summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2012-08-13 17:31:22 +0800
committerWu-cheng Li <wuchengli@google.com>2012-08-13 17:40:42 +0800
commite89a4e7d2808b44b2da6827d13d6da6ce0998896 (patch)
tree523f4d184c958ec54c53a88608a966a6e0513a75
parentde8079dab0123ea087c3c9adbcf1c476bcf79a42 (diff)
downloadandroid_packages_apps_Snap-e89a4e7d2808b44b2da6827d13d6da6ce0998896.tar.gz
android_packages_apps_Snap-e89a4e7d2808b44b2da6827d13d6da6ce0998896.tar.bz2
android_packages_apps_Snap-e89a4e7d2808b44b2da6827d13d6da6ce0998896.zip
Make a copy of MotionEvent in MotionEventHelper.transform.
RotateLayout transforms the event in dispatchTouchEvent. If the event is not handled, the parent of RotateLayout may send the transformed event to other views and the coordinates will be wrong. Make a copy of MotionEvent in transform. This also makes the behavior consistent in different API levels. bug:6974916 Change-Id: Id835767cc9be3f244e5abe2b855e5188045adedc
-rw-r--r--src/com/android/gallery3d/util/MotionEventHelper.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/util/MotionEventHelper.java b/src/com/android/gallery3d/util/MotionEventHelper.java
index 1c9d06244..715f7fa69 100644
--- a/src/com/android/gallery3d/util/MotionEventHelper.java
+++ b/src/com/android/gallery3d/util/MotionEventHelper.java
@@ -38,8 +38,9 @@ public final class MotionEventHelper {
@TargetApi(ApiHelper.VERSION_CODES.HONEYCOMB)
private static MotionEvent transformEventNew(MotionEvent e, Matrix m) {
- e.transform(m);
- return e;
+ MotionEvent newEvent = MotionEvent.obtain(e);
+ newEvent.transform(m);
+ return newEvent;
}
// This is copied from Input.cpp in the android framework.