Fixes a bug with zoom interactions not working correctly.

Before:


https://github.com/tldraw/tldraw/assets/2523721/125e9aaa-681c-4242-bb9e-298dd41b7a97

After:


https://github.com/tldraw/tldraw/assets/2523721/e59b950c-2c55-4663-91cc-fdc0c1403bb0

### Change Type

- [x] `patch` — Bug fix
- [ ] `minor` — New feature
- [ ] `major` — Breaking change
- [ ] `dependencies` — Changes to package dependencies[^1]
- [ ] `documentation` — Changes to the documentation only[^2]
- [ ] `tests` — Changes to any test code only[^2]
- [ ] `internal` — Any other changes that don't affect the published
package[^2]
- [ ] I don't know

[^1]: publishes a `patch` release, for devDependencies use `internal`
[^2]: will not publish a new version

### Test Plan

1. Zooming via the minimap should now correctly go through the zoom
steps.
2. Other zoom interactions should work correctly (things like zoom to
selection, zoom to 100%,...).

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

### Release Notes

- Fixes an issue with the camera and zooming.
pull/2833/head
Mitja Bezenšek 2024-02-13 14:34:17 +01:00 zatwierdzone przez GitHub
rodzic 8f9e6e4533
commit e10c7cb8a9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -2530,7 +2530,7 @@ export class Editor extends EventEmitter<TLEventMap> {
return this._setCamera({
x: -targetViewportPage.x,
y: -targetViewportPage.y,
z: viewportPageBounds.width / targetViewportPage.width,
z: this.getViewportScreenBounds().width / targetViewportPage.width,
})
}