From b3535f3926a42a254985c456e9231768aade3595 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 2 Oct 2013 10:57:22 +0200 Subject: Android: Don't throw away slow-moving mouse/touch events When doing slow, precise movements, some devices will report differences of less than 1 pixel. This would mark the points as stationary, meaning that Qt would discard them without reporting. On the three devices I have tested, stationary points are reported with a 0.0 difference. If any devices are reporting noisy values, it is still safer to test for equality, since it is much better to report too many move events than to not report any. Task-number: QTBUG-33729 Change-Id: If20f2758f5a5ec0917184345b558f55a3d383807 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/android/jar/src/org/qtproject/qt5/android/QtNative.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/android/jar') 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 f5bfe7e029..1385c90e3e 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -297,8 +297,8 @@ public class QtNative if (action == MotionEvent.ACTION_MOVE) { int hsz = event.getHistorySize(); if (hsz > 0) { - if (Math.abs(event.getX(index) - event.getHistoricalX(index, hsz-1)) > 1 - || Math.abs(event.getY(index) - event.getHistoricalY(index, hsz-1)) > 1) { + if (event.getX(index) != event.getHistoricalX(index, hsz-1) + || event.getY(index) != event.getHistoricalY(index, hsz-1)) { return 1; } else { return 2; -- cgit v1.2.3