-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
perf: improve new element drawing #8340
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
|
@ryan-di Haven't had time to go through the code yet, but in collab it seems to break down (just being in the collab, no one else needs to be doing anything), where it's drawing the new element on both canvases or something. Otherwise, when it works, it's great! Looking forward to shipping this! 🔥 |
8ebdb35 to
e635f2e
Compare
3c5b027 to
165c8a9
Compare
|
In order to remove as much of the sceneNonce hacks as possible in anticipation of splitting it into Further, I've actually removed all the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're good to go! 🚀
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
Previously, when an element is created, it's added to the scene and updated with
informMutation, leading to an increase/change in scene version. This means thatStaticCanvas, which gets re-rendered as the scene version updates, re-renders on every update happening to the new element. Given a large enough scene, we would see significant lags. And for elements like free draws, this kind of lag is perceived poorly.This PR improves the drawing of new elements by
Implementation wise, building on the previous
draggingElement->newElementrefactor, we havenewElementpoints to a new (non-selection) element that's being creatededitingElementgets renamed toeditingTextElementand is only used for a text that's being created/editednewElementisnulland trigger scene updates so that the newly created element is rendered on the static canvas insteadRight now, this new element drawing improvement is only in the single player mode. Whether we should bring this feature over to collaboration mode remains to be seen.