Skip to content

Commit

Permalink
Better standards-compliant fix for browser.test_sdl_touch that works …
Browse files Browse the repository at this point in the history
…on Chrome as well.
  • Loading branch information
juj committed Apr 16, 2014
1 parent 4045e65 commit 11dfeed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/sdl_touch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 } ] });
Expand Down

0 comments on commit 11dfeed

Please sign in to comment.