diff options
| author | 2009-12-02 18:56:20 -0800 | |
|---|---|---|
| committer | 2009-12-02 18:56:20 -0800 | |
| commit | a45e925108f6c9d35d9e7b5e8def9aba49ee0dba (patch) | |
| tree | 34f759ed66ff8f4230209012ee6356233287cdad | |
| parent | 21eb173864670c2f759258016d95f0bcd06313e7 (diff) | |
| parent | dcd58cfda366c915b1f0739cb115f9d972351c73 (diff) | |
am dcd58cfd: Merge change I7b9328c7 into eclair
Merge commit 'dcd58cfda366c915b1f0739cb115f9d972351c73' into eclair-mr2
* commit 'dcd58cfda366c915b1f0739cb115f9d972351c73':
Fix issue #2300232: Bugs in resolving conflicting pointers
| -rw-r--r-- | services/java/com/android/server/InputDevice.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/services/java/com/android/server/InputDevice.java b/services/java/com/android/server/InputDevice.java index 7c19f243adad..6f207e0ff8b9 100644 --- a/services/java/com/android/server/InputDevice.java +++ b/services/java/com/android/server/InputDevice.java @@ -313,14 +313,17 @@ public class InputDevice { long bestDistance = -1; int bestIndex = -1; for (int j=0; j<lastNumPointers; j++) { - if (!allowOverlap && last2Next[j] < 0) { + // If we are not allowing multiple new points to be assigned + // to the same old pointer, then skip this one if it is already + // detected as a conflict (-2). + if (!allowOverlap && last2Next[j] < -1) { continue; } final int jd = j * MotionEvent.NUM_SAMPLE_DATA; final int xd = lastData[jd + MotionEvent.SAMPLE_X] - x1; final int yd = lastData[jd + MotionEvent.SAMPLE_Y] - y1; final long distance = xd*(long)xd + yd*(long)yd; - if (j == 0 || distance < bestDistance) { + if (bestDistance == -1 || distance < bestDistance) { bestDistance = distance; bestIndex = j; } |