summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/javascript/js/libs/library_godot_input.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/javascript/js/libs/library_godot_input.js b/platform/javascript/js/libs/library_godot_input.js
index 3c1c05e44e..945dbba902 100644
--- a/platform/javascript/js/libs/library_godot_input.js
+++ b/platform/javascript/js/libs/library_godot_input.js
@@ -424,9 +424,9 @@ const GodotInput = {
for (let i = 0; i < touches.length; i++) {
const touch = touches[i];
const pos = GodotInput.computePosition(touch, rect);
- GodotRuntime.setHeapValue(coords + (i * 2), pos[0], 'double');
- GodotRuntime.setHeapValue(coords + (i * 2 + 8), pos[1], 'double');
- GodotRuntime.setHeapValue(ids + i, touch.identifier, 'i32');
+ GodotRuntime.setHeapValue(coords + (i * 2) * 8, pos[0], 'double');
+ GodotRuntime.setHeapValue(coords + (i * 2 + 1) * 8, pos[1], 'double');
+ GodotRuntime.setHeapValue(ids + i * 4, touch.identifier, 'i32');
}
func(type, touches.length);
if (evt.cancelable) {