tldraw/apps
Steve Ruiz 79460cbf3a
Use canvas bounds for viewport bounds (#2798)
This PR changes the way that viewport bounds are calculated by using the
canvas element as the source of truth, rather than the container. This
allows for cases where the canvas is not the same dimensions as the
component. (Given the way our UI and context works, there are cases
where this is desired, i.e. toolbars and other items overlaid on top of
the canvas area).

The editor's `getContainer` is now only used for the text measurement.
It would be good to get that out somehow.

# Pros

We can inset the canvas

# Cons

We can no longer imperatively call `updateScreenBounds`, as we need to
provide those bounds externally.

### Change Type

- [x] `major` — Breaking change

### Test Plan

1. Use the examples, including the new inset canvas example.

- [x] Unit Tests

### Release Notes

- Changes the source of truth for the viewport page bounds to be the
canvas instead.
2024-02-12 15:03:25 +00:00
..
docs docs: better code snippets (#2801) 2024-02-12 14:30:55 +00:00
dotcom Use canvas bounds for viewport bounds (#2798) 2024-02-12 15:03:25 +00:00
dotcom-asset-upload dev: add test-dev command for easier testing of packages (#2627) 2024-01-29 10:29:38 +00:00
dotcom-bookmark-extractor Bump Yarn to 4.0.2 and add version constraints (#2481) 2024-01-18 11:09:17 +00:00
dotcom-worker Unbiome (#2776) 2024-02-07 16:02:22 +00:00
examples Use canvas bounds for viewport bounds (#2798) 2024-02-12 15:03:25 +00:00
health-worker Update the project to Node 20 (#2691) 2024-01-31 16:53:40 +00:00
huppy make CI check for yarn install warnings and fix the peer deps ones we have (#2683) 2024-01-30 11:41:46 +00:00
vscode VS Code 2.0.23 (#2756) 2024-02-06 15:41:44 +00:00