aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/sdl_touch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/sdl_touch.c b/tests/sdl_touch.c
index f6a8834b..dc315c58 100644
--- a/tests/sdl_touch.c
+++ b/tests/sdl_touch.c
@@ -67,8 +67,8 @@ int main() {
Module['canvas'].dispatchEvent(event);
}
// Pass test coordinates in canvas element coordinate frame.
- var x = Module['canvas'].getBoundingClientRect().x;
- var y = Module['canvas'].getBoundingClientRect().y;
+ var x = Module['canvas'].getBoundingClientRect().left;
+ var y = Module['canvas'].getBoundingClientRect().top;
sendEvent('touchstart', { touches: [ { pageX: x+300, pageY: y+225, deviceID: 1, identifier: 1, force: 1 } ] });
sendEvent('touchmove', { touches: [ { pageX: x+400, pageY: y+225, deviceID: 1, identifier: 1, force: 1 } ] });
sendEvent('touchend', { changedTouches: [ { pageX: x+400, pageY: y+225, deviceID: 1, identifier: 1, force: 1 } ] });