You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Since we were creating a temp canvas to make sure that the bounding box of label is computed correctly when arrow is rotated since we needed to clear that area in label and this was happening for every render irrespective of whether the arrow was updated and hence slowing down the whole app for large number of labeled arrows.
Now I am caching the canvas for bound text elements along with the elementWithCanvasCache, significantly improving performance.
However, for rotation we still need to compute the bounding box on the fly hence I am bursting the cache for rotation. We can improve this further later
There is also one more issue with rotation which is in production as well - Try updating text in rotated arrow and text position gets updated, I will fix this in another PR.
* perf: cache the temp canvas created for labeled arrows
* use allEleemntsMap so bound text element can be retrieved when editing
* remove logs
* fix rotation
* pass isRotating
* feat: cache `element.angle` instead of relying on `appState.isRotating`
---------
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Try here - https://excalidraw-git-aakansha-fix-labeled-arrow-perf-excalidraw.vercel.app/#json=TVewArjSDX8Eh9Tsquq33,7IbL43nXlxrvuVOB0x6Xnw
for #8257
Since we were creating a temp canvas to make sure that the bounding box of label is computed correctly when arrow is rotated since we needed to clear that area in label and this was happening for every render irrespective of whether the arrow was updated and hence slowing down the whole app for large number of labeled arrows.
Now I am caching the canvas for bound text elements along with the elementWithCanvasCache, significantly improving performance.
However, for rotation we still need to compute the bounding box on the fly hence I am bursting the cache for rotation. We can improve this further later
There is also one more issue with rotation which is in production as well - Try updating text in rotated arrow and text position gets updated, I will fix this in another PR.
perf-arrow.mp4