Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_pointerDownEvent now reuses the _activeTouchIds slot if _pointerMove… #15115

Merged
merged 1 commit into from
May 20, 2024

Conversation

AmoebaChant
Copy link
Contributor

@AmoebaChant AmoebaChant commented May 17, 2024

On some devices, pen inputs can start with pointerMove instead of pointerDown. In that case, we were adding the pointerId to the _activeTouchIds in pointerMove, and instead of reusing that slot when pointerDown came along later, we were grabbing a second slot for the pointerId. Then later, when pointerUp came along, we only cleaned up one of them.

With this change, pointerDown will reuse the existing slot if found - grabbing a new slot only if this pointerId doesn't already have one, so we should no longer get one pointerId in two slots.

Reported in the forum here: https://forum.babylonjs.com/t/hitting-max-number-of-touches-exceeded-ignoring-touches-in-excess-of-5-when-using-a-pen-on-a-tablet-samsung-s-pen/50593

…Event had already reserved it for this pointerId
@bjsplat
Copy link
Collaborator

bjsplat commented May 17, 2024

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented May 17, 2024

@sebavan
Copy link
Member

sebavan commented May 17, 2024

Is there a way to simulate it in the input unit tests ?

@bjsplat
Copy link
Collaborator

bjsplat commented May 17, 2024

@bjsplat
Copy link
Collaborator

bjsplat commented May 17, 2024

Visualization tests for WebGPU (Experimental)
Important - these might fail sporadically. This is an optional test.

https://babylonsnapshots.z22.web.core.windows.net/refs/pull/15115/merge/testResults/webgpuplaywright/index.html

@deltakosh deltakosh merged commit aa2398e into master May 20, 2024
11 checks passed
@deltakosh deltakosh deleted the fix-pen-stops-working-after-several-interactions branch May 20, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants