Repository: godot
Issue: Incorrect Calculation of event.relative for InputEventScreenDrag with Multitouch in Web Version
Labels: bug,platform:web,topic:input

### Tested versions

**Reproducible in:**
- 4.3 beta3
- 4.2.2 stable
- I haven't checked any further

**System Information:**
- Godot Engine version: 4.x (maybe in Godot 3.x too)
- Two different HTTP Servers and Itch.io
- OS/device including version: Web Version
- Issue reproduction rate: ~100% with multitouch


### System information

Android 12-13, iOS 17, web, gl_compatible, 

### Issue description

When running in the web version of Godot Engine 4 (regardless of Thread Support), there are issues with the calculation of `event.relative` for `InputEventScreenDrag` during multitouch. Specifically, other touches seem to influence the relative values of different touches, despite the position for each touch index remaining unchanged.

![image](https://github.com/user-attachments/assets/f2e3d14d-68d2-4392-9123-699867c082c7)

In the video example, you can see that the right hand (which controls the camera) I'm barely moving (can be tracked by Position at index 0). And the actions of the second index clearly affect the relative of index 0

https://github.com/user-attachments/assets/f4eacb8d-1692-4f1e-8d1e-8111af22a11e


### Steps to reproduce

1. Run the provided example code in the web version of Godot Engine 4.
2. Perform multitouch gestures on the screen.
3. Observe the inconsistent behavior of `event.relative` values.

**Expected Behavior:**
Each touch should independently have accurate `event.relative` values based on its movement, unaffected by other touches.

**Actual Behavior:**
The `event.relative` values are incorrectly influenced by other touches, resulting in erratic and incorrect behavior.

**Example Code with Issue:**

```gdscript
extends Node

var sensitivity := 0.5

func _input(event):
    if event is InputEventScreenDrag and event.index == 0:
        # Check if the touch event is pressed and in the right half of the screen
        if event.position.x >= get_viewport().size.x / 2:
            %head.rotate_x(-deg_to_rad(event.screen_relative.y * sensitivity))
            rotate_y(-deg_to_rad(event.screen_relative.x * sensitivity))
```

**Example Code with Fix (Reinventing `relative`):**

```gdscript
extends Node

var last_position := Vector2(0, 0)
var is_dragging := false
var relative

const sensitivity := 0.5

func _input(event):
    if event is InputEventScreenDrag:
        # Check if the touch event is pressed and in the right half of the screen
        if event.position.x >= get_viewport().size.x / 2:
            if is_dragging:
                relative = event.position - last_position
                %head.rotate_x(-deg_to_rad(relative.y * sensitivity))
                rotate_y(-deg_to_rad(relative.x * sensitivity))
            last_position = event.position
            is_dragging = true
    elif event is InputEventScreenTouch:
        if not event.pressed:
            is_dragging = false
```

### Minimal reproduction project (MRP)

[First Person Controller.zip](https://github.com/user-attachments/files/16216663/First.Person.Controller.zip)