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 */
|
/** @internal */
|
||||||
@computed
|
@computed
|
||||||
private getCameraId() {
|
private _unsafe_getCameraId() {
|
||||||
return CameraRecordType.createId(this.getCurrentPageId())
|
return CameraRecordType.createId(this.getCurrentPageId())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2081,7 +2081,7 @@ export class Editor extends EventEmitter<TLEventMap> {
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
@computed getCamera(): TLCamera {
|
@computed getCamera(): TLCamera {
|
||||||
const baseCamera = this.store.get(this.getCameraId())!
|
const baseCamera = this.store.get(this._unsafe_getCameraId())!
|
||||||
if (this._isLockedOnFollowingUser.get()) {
|
if (this._isLockedOnFollowingUser.get()) {
|
||||||
const followingCamera = this.getCameraForFollowing()
|
const followingCamera = this.getCameraForFollowing()
|
||||||
if (followingCamera) {
|
if (followingCamera) {
|
||||||
|
@ -8333,7 +8333,7 @@ export class Editor extends EventEmitter<TLEventMap> {
|
||||||
} = this.inputs
|
} = this.inputs
|
||||||
|
|
||||||
const { screenBounds } = this.store.unsafeGetWithoutCapture(TLINSTANCE_ID)!
|
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 sx = info.point.x - screenBounds.x
|
||||||
const sy = info.point.y - screenBounds.y
|
const sy = info.point.y - screenBounds.y
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue