mirror of
https://github.com/godotengine/godot.git
synced 2024-11-13 23:52:41 +00:00
[HTML5] Fix multi-touch input handling.
The code to populate the input data for WebAssembly was incorrectly overriding values when multiple touches were present due to wrong indexing.
This commit is contained in:
parent
aa74494ab9
commit
470496d8d4
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user