d399c027fd
This PR tweaks the logic of _when_ we update the viewport screen bounds. Previously, we updated every one second in order to capture any changes to the viewport's screen position. In this PR, we _check_ every one second and update the screen bounds if the viewport's screen position has actually changed. Since we also update the rendering shapes when this happens, it would cause the rendering / culling shapes to update while the camera was moving. I've also removed the "maximum time before we start culling shapes", as this wasn't very useful and could also cause frames to start dropping without recovering. https://github.com/tldraw/tldraw/assets/23072548/9f474481-30c9-49b4-a009-66775ca6a0c1 ### Change Type <!-- ❗ Please select a 'Scope' label ❗️ --> - [x] `sdk` — Changes the tldraw SDK - [ ] `dotcom` — Changes the tldraw.com web app - [ ] `docs` — Changes to the documentation, examples, or templates. - [ ] `vs code` — Changes to the vscode plugin - [ ] `internal` — Does not affect user-facing stuff <!-- ❗ Please select a 'Type' label ❗️ --> - [ ] `bugfix` — Bug fix - [ ] `feature` — New feature - [x] `improvement` — Improving existing features - [ ] `chore` — Updating dependencies, other boring stuff - [ ] `galaxy brain` — Architectural changes - [ ] `tests` — Changes to any test code - [ ] `tools` — Changes to infrastructure, CI, internal scripts, debugging tools, etc. - [ ] `dunno` — I don't know ### Test Plan 1. Zoom and pan around 2. Culled shapes should only update when you stop moving the camera. - [ ] Unit Tests - [ ] End to end tests ### Release Notes - Improve performance of the canvas when many shapes are present. |
||
---|---|---|
.. | ||
api | ||
src | ||
api-extractor.json | ||
api-report.md | ||
CHANGELOG.md | ||
editor.css | ||
LICENSE.md | ||
package.json | ||
README.md | ||
setupTests.js | ||
tsconfig.json |
tldraw/tldraw
Community
Have questions, comments or feedback? Join our discord or start a discussion.
Distributions
You can find tldraw on npm here.
Contribution
Please see our contributing guide. Found a bug? Please submit an issue.
License
The tldraw source code and its distributions are provided under the tldraw license. This license does not permit commercial use.
If you wish to use this project in commercial product, you need to purchase a commercial license. Please contact us at hello@tldraw.com for more inforion about obtaining a commercial license.
Trademarks
Copyright (c) 2023-present tldraw Inc. The tldraw name and logo are trademarks of tldraw. Please see our trademark guidelines for info on acceptable usage.
Contact
Find us on Twitter at @tldraw or email hello@tldraw.com. You can also join our discord for quick help and support.