-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
fix(useRaycaster): set delta on pointer-missed events #853
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for tresjs-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi, @andretchen0 is this contemplated in your refactor #844? Should we merge this PR first? |
In the event system rewrite, Here's the code. (It's called const distance = (incomingEvent.type === 'click' || incomingEvent.type === 'contextmenu' || incomingEvent.type === 'dblclick' || incomingEvent.type === 'pointerup')
? Math.sqrt(((incomingEvent.offsetX - config.pointerDownPosition.x) ** 2) + ((incomingEvent.offsetY - config.pointerDownPosition.y) ** 2))
: 0 Also in the rewrite, users can supply their own Fwiw, for the use case under discussion, the new system also implements pointer capture, which makes dragging things around a lot simpler.
I don't have a feeling one way or another on this one. |
Fwiw, the new event system sets Screen.Recording.2024-10-17.at.13.11.31.movBut,
So, again, I don't have a strong opinion here. We can merge here if it helps someone, but there are changes in the pipeline for the next major version. |
Fixes #852.
Introduces a very small overhead because the delta is computed for every pointerup event.