(type, gameX, gameY)
| 19 | // coordinates via the canvas bounding rect so the test is independent of |
| 20 | // how `scale: "auto"` sized/positioned the canvas in the runner page |
| 21 | const dispatchPointer = (type, gameX, gameY) => { |
| 22 | const canvas = video.renderer.getCanvas(); |
| 23 | const rect = canvas.getBoundingClientRect(); |
| 24 | canvas.dispatchEvent( |
| 25 | new PointerEvent(type, { |
| 26 | clientX: rect.left + (gameX * rect.width) / canvas.width, |
| 27 | clientY: rect.top + (gameY * rect.height) / canvas.height, |
| 28 | pointerId: 1, |
| 29 | width: 1, |
| 30 | height: 1, |
| 31 | isPrimary: true, |
| 32 | bubbles: true, |
| 33 | }), |
| 34 | ); |
| 35 | }; |
| 36 | |
| 37 | const syncBroadphase = () => { |
| 38 | game.world.broadphase.clear(); |
no test coverage detected