diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2015-03-06 13:37:44 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@digia.com> | 2015-03-09 10:20:06 +0000 |
commit | 21a0e3c111b97035a01b6386a4e9ecda2d2febf8 (patch) | |
tree | 6019a73c80b4750b28e9df39a18a5cd3a1a1a814 /src/android | |
parent | 3ff80d1fe4c35f68bcebde7dccfde7b0fb03014f (diff) |
Android: don't assume a stationary touchpoint unless all history agrees
We need to compare each historical location (not just one of them)
against the present location to prove that the touchpoint didn't move.
We still don't actually send events for every historical touchpoint
location though, because that would multiply the event traffic.
Task-number: QTBUG-38379
Change-Id: I4b968ef6877031a157493d0a248564c78195c033
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Diffstat (limited to 'src/android')
-rw-r--r-- | src/android/jar/src/org/qtproject/qt5/android/QtNative.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java index 8e35840a20..bed9d69782 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -279,12 +279,14 @@ public class QtNative if (action == MotionEvent.ACTION_MOVE) { int hsz = event.getHistorySize(); if (hsz > 0) { - if (event.getX(index) != event.getHistoricalX(index, hsz-1) - || event.getY(index) != event.getHistoricalY(index, hsz-1)) { - return 1; - } else { - return 2; + float x = event.getX(index); + float y = event.getY(index); + for (int h = 0; h < hsz; ++h) { + if ( event.getHistoricalX(index, h) != x || + event.getHistoricalY(index, h) != y ) + return 1; } + return 2; } return 1; } |