Fix pinch zooming (#2748)

This PR fixes pinch zooming not working on touch screens.

Tested on android chrome, windows, ipad.

### Change Type

- [x] `patch` — Bug fix

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

### Test Plan

1. On a touch screen, try to pinch zoom in and out. Does it work?

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

### Release Notes

- None: Fixes an unreleased bug.
pull/2753/head
Lu Wilson 2024-02-06 12:28:26 +00:00 zatwierdzone przez GitHub
rodzic 51f9e630ac
commit f2ec7be62e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -8588,11 +8588,12 @@ export class Editor extends EventEmitter<TLEventMap> {
if (!inputs.isPinching) return
const {
point: { z = 1 },
delta: { x: dx, y: dy },
} = info
const { screenBounds } = this.store.unsafeGetWithoutCapture(TLINSTANCE_ID)!
const { x, y, z = 1 } = Vec.SubXY(info.point, screenBounds.x, screenBounds.y)
const { x, y } = Vec.SubXY(info.point, screenBounds.x, screenBounds.y)
const { x: cx, y: cy, z: cz } = this.getCamera()