tldraw/packages
Mitja Bezenšek de55259c92
Fix an issue with the minimap (#3617)
In some cases (when you clicked close to the current viewport area) the
minimap would not change the camera position. This is because the
`clampedPoint` calculation would offset the clicked position slightly
and then the `clampedPoint` would land inside the currently viewport.

With this change we will treat every click outside of the viewport (but
still within allowed bounds) as a change that requires use to change the
camera position.

Before


https://github.com/tldraw/tldraw/assets/2523721/ded202d1-94d7-4b40-ba77-45d283e4fa60

After


https://github.com/tldraw/tldraw/assets/2523721/2ccee77d-ec0e-4997-b51d-c14676657a94


### Change Type

<!--  Please select a 'Scope' label ️ -->

- [ ] `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
- [x] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [x] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `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. Use minimap in various ways to make sure it still works correctly.
The change targets the `pointerDown` event, but I did also refactor one
method that is also used by double click so it makes sense to test that
as well. Make sure you are not double clicking since we don't use the
same logic there.

- [ ] Unit Tests
- [ ] End to end tests

### Release Notes

- Fixes clicking on the minimap when we clicked just slightly outside of
the current viewport.
2024-04-26 13:00:43 +00:00
..
assets delete untracked api.json and stale api-report.md files (#3619) 2024-04-25 17:27:28 +00:00
dotcom-shared Readonly / room creation omnibus (#3192) 2024-04-25 14:10:40 +00:00
editor Automatic undo/redo (#3364) 2024-04-24 18:26:10 +00:00
namespaced-tldraw Don't check api.json files into git (#3565) 2024-04-24 15:58:26 +00:00
state Revert "[signia] Smart dirty checking of active computeds (#3516)" (#3612) 2024-04-25 12:45:36 +00:00
store Automatic undo/redo (#3364) 2024-04-24 18:26:10 +00:00
tldraw Fix an issue with the minimap (#3617) 2024-04-26 13:00:43 +00:00
tlschema Expose migrations, validators, and versions from tlschema (#3613) 2024-04-25 14:31:26 +00:00
tlsync delete untracked api.json and stale api-report.md files (#3619) 2024-04-25 17:27:28 +00:00
utils Don't check api.json files into git (#3565) 2024-04-24 15:58:26 +00:00
validate Don't check api.json files into git (#3565) 2024-04-24 15:58:26 +00:00