219e2f63dd
This PR: - shrinks the distance for edge scrolling and insets the distance for coarse pointers - adds edge inset tracking ## Scroll distances Rather than increasing the distance, we move the "zero" in from the edges, so that the middle of a honkin' fat finger would be at "zero" when the edge of the finger is touching the edge of the screen. This is a bit more reliable than looking at just the component size. ## Inset tracking We now track whether a shape's edges are identical to the edges of the document body. When an edge is inset, we extend the edge scrolling distance outside of the component, so that dragging PAST the edge of the component will scroll. When an edge is NOT inset, we bring that distance into the component's bounds, so that dragging NEAR TO the edge will begin to scroll. ![image](https://github.com/tldraw/tldraw/assets/23072548/bb216c98-3dd0-4e2e-a635-4c4f339d5117) ![image](https://github.com/tldraw/tldraw/assets/23072548/75e83c81-1ca9-40a9-8edc-72851d3b1411) ![image](https://github.com/tldraw/tldraw/assets/23072548/6cda7bda-2935-4ded-821c-e7bf78833a1c) ### Change Type - [x] `minor` — New feature ### Test Plan 1. Use edge scrolling on mobile 2. Use edge scrolling on desktop 3. Use edge scrolling in the "scrolling example" - [x] Unit Tests ### Release Notes - Add `instanceState.insets` to track which edges of the component are inset from the edges of the document body. - Improve behavior around edge scrolling |
||
---|---|---|
.. | ||
lib | ||
index.ts | ||
version.ts |