diff options
| author | 2012-09-26 17:12:50 -0700 | |
|---|---|---|
| committer | 2012-09-26 17:12:50 -0700 | |
| commit | abde042a824c3fc2f3537ef136017dfa006258b9 (patch) | |
| tree | ffafb50a68bdb9a8161b1e2c87429df861fff549 | |
| parent | 4368ba45adebf17d7962ad551363ac302cb2b1c7 (diff) | |
ScaleGestureDetector bugfixes
* Use radius, not diameter.
* Properly determine initial span on ACTION_DOWN.
Change-Id: Ia1dcff6589f8226181a9beaecef34440e9e16330
| -rw-r--r-- | core/java/android/view/ScaleGestureDetector.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/view/ScaleGestureDetector.java b/core/java/android/view/ScaleGestureDetector.java index 123ce2a92d9b..b0a271198ca2 100644 --- a/core/java/android/view/ScaleGestureDetector.java +++ b/core/java/android/view/ScaleGestureDetector.java @@ -314,7 +314,7 @@ public class ScaleGestureDetector { } } - final boolean configChanged = + final boolean configChanged = action == MotionEvent.ACTION_DOWN || action == MotionEvent.ACTION_POINTER_UP || action == MotionEvent.ACTION_POINTER_DOWN; final boolean pointerUp = action == MotionEvent.ACTION_POINTER_UP; @@ -344,7 +344,7 @@ public class ScaleGestureDetector { if (skipIndex == i) continue; // Average touch major and touch minor and convert the resulting diameter into a radius. - final float touchSize = getAdjustedTouchHistory(event.getPointerId(i)); + final float touchSize = getAdjustedTouchHistory(event.getPointerId(i)) / 2; devSumX += Math.abs(event.getX(i) - focusX) + touchSize; devSumY += Math.abs(event.getY(i) - focusY) + touchSize; } |