fix input coords while viewport following (#4108)
closes [#4106](https://github.com/tldraw/tldraw/issues/4106) ### Change type - [x] `bugfix` - [ ] `improvement` - [ ] `feature` - [ ] `api` - [ ] `other` ### Test plan 1. Create a shape... 2. - [ ] Unit tests - [ ] End to end tests ### Release notes - Fixed a bug with…
This commit is contained in:
parent
710a70bf0e
commit
7e561e54e5
1 changed files with 3 additions and 3 deletions
|
@ -2071,7 +2071,7 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|||
|
||||
/** @internal */
|
||||
@computed
|
||||
private getCameraId() {
|
||||
private _unsafe_getCameraId() {
|
||||
return CameraRecordType.createId(this.getCurrentPageId())
|
||||
}
|
||||
|
||||
|
@ -2081,7 +2081,7 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|||
* @public
|
||||
*/
|
||||
@computed getCamera(): TLCamera {
|
||||
const baseCamera = this.store.get(this.getCameraId())!
|
||||
const baseCamera = this.store.get(this._unsafe_getCameraId())!
|
||||
if (this._isLockedOnFollowingUser.get()) {
|
||||
const followingCamera = this.getCameraForFollowing()
|
||||
if (followingCamera) {
|
||||
|
@ -8333,7 +8333,7 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|||
} = this.inputs
|
||||
|
||||
const { screenBounds } = this.store.unsafeGetWithoutCapture(TLINSTANCE_ID)!
|
||||
const { x: cx, y: cy, z: cz } = this.store.unsafeGetWithoutCapture(this.getCameraId())!
|
||||
const { x: cx, y: cy, z: cz } = unsafe__withoutCapture(() => this.getCamera())
|
||||
|
||||
const sx = info.point.x - screenBounds.x
|
||||
const sy = info.point.y - screenBounds.y
|
||||
|
|
Loading…
Reference in a new issue