-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
events: explore using getCoalescedEvents #5554
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
this is so fucking cool?????? |
so, thinking about this a bit more... do we know of a reason we shouldn't do this? |
There could be a hesititation around when there's a lot of shapes being manipulated, say, selecting a lot of shapes on the canvas and moving them around all at once, maybe that affects perf? @MitjaBezensek wdyt? Or, well, say using the Hand tool and doing the same, moving the canvas around. |
I think this definitely makes sense for events where high precision brings some benefits - like while drawing since it allows us to make drawings that more closely follow the user's input. For other cases it might actually be worse. The fact that browser coalesces events means that it determined the the device is not capable enough to process all of them, so it starts coalescing them. We did run into some problems when we tried something like this before, see this PR, especially the coalescing part: |
Let's dig into that a bit , specifically, in the PR you reference it says:
|
Wanted to open a discussion on
getCoalescedEvents
and see if it's worth integrating into the canvas. The videos below show trying to draw with a CPU 20x slowdown.(I know we've talked about
getPredictedEvents
but that's a separate topic)Testbed: https://patrickhlauke.github.io/touch/coalesced-predicted-events/
Before:
Kapture.2025-03-04.at.17.07.35.mp4
After:
Kapture.2025-03-04.at.17.09.11.mp4
Change type
bugfix
improvement
feature
api
other
Release notes