tldraw/packages
Steve Ruiz e764e59cda
[tiny] Slightly more efficient selection rotated page bounds / page bounds (#3178)
This PR makes a few tiny improvements to the way that selection page
bounds and rotated page bounds are calculated.

For bounds, we bail once we find a different rotation among the selected
shapes. Previously, we grabbed all of the rotations first before
comparing them; we only need to grab rotations until we find a rotation
that's different from the first one.

For rotating page bounds, we only look at the corners of the calculated
bounds, and we mutate the resulting points after we transform them.
Previously, we looked at all vertices and make a copy of the points when
rotating them. The transform already creates the copy, so we can mutate
it; and while the bounds are usually calculated from the vertices, using
the corners gives us fewer points to transform.

### 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


### Release Notes

- SDK, slightly more performant selection bounds calculations.
2024-03-17 13:24:32 +00:00
..
assets Update CHANGELOG.md [skip ci] 2024-02-29 18:28:45 +00:00
editor [tiny] Slightly more efficient selection rotated page bounds / page bounds (#3178) 2024-03-17 13:24:32 +00:00
namespaced-tldraw Remove namespaced-tldraw/tldraw.css (#3068) 2024-03-04 17:13:12 +00:00
state [perf] Reinstate render throttling (#3160) 2024-03-15 16:18:23 +00:00
store Performance improvements (#2977) 2024-03-11 13:17:31 +00:00
tldraw fixup file helpers (#3130) 2024-03-12 16:51:29 +00:00
tlschema Remove dependabot config since it only controls version updates? (#3057) 2024-03-04 13:19:51 +00:00
tlsync [sync] allow connections from v4 clients (#3173) 2024-03-16 10:21:37 +00:00
utils fixup file helpers (#3130) 2024-03-12 16:51:29 +00:00
validate Update CHANGELOG.md [skip ci] 2024-02-29 18:28:45 +00:00