aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/android/events.cpp
diff options
context:
space:
mode:
authordhewg2011-03-17 20:48:44 +0100
committerdhewg2011-03-17 21:01:49 +0100
commit8953581ec9dcde966ec7a5e2e7f2c37a4cf4d109 (patch)
tree66ca6188aaf61b70c824ccd5405115534c16d61b /backends/platform/android/events.cpp
parent563ac93c166f31864c2bcaa9e99e71e2c5882910 (diff)
downloadscummvm-rg350-8953581ec9dcde966ec7a5e2e7f2c37a4cf4d109.tar.gz
scummvm-rg350-8953581ec9dcde966ec7a5e2e7f2c37a4cf4d109.tar.bz2
scummvm-rg350-8953581ec9dcde966ec7a5e2e7f2c37a4cf4d109.zip
ANDROID: Ignore the slop area on all touch scrolls
Prevents initial cursor jumps
Diffstat (limited to 'backends/platform/android/events.cpp')
-rw-r--r--backends/platform/android/events.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp
index b8e8d8e69c..cab09e04dd 100644
--- a/backends/platform/android/events.cpp
+++ b/backends/platform/android/events.cpp
@@ -444,13 +444,22 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3,
case JE_DOWN:
_touch_pt_down = getEventManager()->getMousePos();
+ _touch_pt_scroll.x = -1;
+ _touch_pt_scroll.y = -1;
break;
case JE_SCROLL:
e.type = Common::EVENT_MOUSEMOVE;
if (_touchpad_mode) {
- scaleMouse(e.mouse, arg3 - arg1, arg4 - arg2, false);
+ if (_touch_pt_scroll.x == -1 && _touch_pt_scroll.y == -1) {
+ _touch_pt_scroll.x = arg3;
+ _touch_pt_scroll.y = arg4;
+ return;
+ }
+
+ scaleMouse(e.mouse, arg3 - _touch_pt_scroll.x,
+ arg4 - _touch_pt_scroll.y, false);
e.mouse += _touch_pt_down;
clipMouse(e.mouse);
} else {
@@ -520,14 +529,20 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3,
switch (arg3) {
case JACTION_DOWN:
dptype = Common::EVENT_LBUTTONDOWN;
- _touch_pt_dt.x = arg1;
- _touch_pt_dt.y = arg2;
+ _touch_pt_dt.x = -1;
+ _touch_pt_dt.y = -1;
break;
case JACTION_UP:
dptype = Common::EVENT_LBUTTONUP;
break;
+ // held and moved
case JACTION_MULTIPLE:
- // held and moved
+ if (_touch_pt_dt.x == -1 && _touch_pt_dt.y == -1) {
+ _touch_pt_dt.x = arg1;
+ _touch_pt_dt.y = arg2;
+ return;
+ }
+
dptype = Common::EVENT_MOUSEMOVE;
if (_touchpad_mode) {