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. |
||
---|---|---|
.. | ||
assets | ||
editor | ||
namespaced-tldraw | ||
state | ||
store | ||
tldraw | ||
tlschema | ||
tlsync | ||
utils | ||
validate |