mirror of
https://github.com/logseq/logseq.git
synced 2026-05-25 13:14:39 +00:00
fix: pinching center offset
This commit is contained in:
@@ -38,7 +38,7 @@ export class TLInputs<K extends TLEventMap> {
|
||||
) {
|
||||
if ('clientX' in event) {
|
||||
this.previousScreenPoint = this.currentScreenPoint
|
||||
this.currentScreenPoint = Vec.add([event.clientX, event.clientY], this.containerOffset)
|
||||
this.currentScreenPoint = Vec.sub([event.clientX, event.clientY], this.containerOffset)
|
||||
}
|
||||
if ('shiftKey' in event) {
|
||||
this.shiftKey = event.shiftKey
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import type { AnyObject, TLDocumentModel, TLTheme, TLToolConstructor } from '@tldraw/core'
|
||||
import type * as React from 'react'
|
||||
import type { TLReactApp, TLReactShape, TLReactShapeConstructor } from '~lib'
|
||||
import { AppProvider } from '~components'
|
||||
import type {
|
||||
AnyObject,
|
||||
TLDocumentModel,
|
||||
TLCallback,
|
||||
TLTheme,
|
||||
TLToolConstructor,
|
||||
} from '@tldraw/core'
|
||||
import type { TLReactComponents } from '~types/component-props'
|
||||
import type { TLReactApp, TLReactShape, TLReactShapeConstructor } from '~lib'
|
||||
import type { TLReactCallbacks, TLReactEventMap } from '~types'
|
||||
import type { TLReactComponents } from '~types/component-props'
|
||||
import { AppCanvas } from './AppCanvas'
|
||||
|
||||
export interface TLCommonAppProps<
|
||||
|
||||
@@ -41,7 +41,7 @@ export function useGestureEvents(ref: React.RefObject<HTMLDivElement>) {
|
||||
order: 0,
|
||||
delta: gesture.delta,
|
||||
offset: gesture.offset,
|
||||
point: gesture.origin,
|
||||
point: Vec.sub(gesture.origin, inputs.containerOffset),
|
||||
},
|
||||
event
|
||||
)
|
||||
@@ -58,7 +58,7 @@ export function useGestureEvents(ref: React.RefObject<HTMLDivElement>) {
|
||||
order: 0,
|
||||
delta: gesture.delta,
|
||||
offset: gesture.offset,
|
||||
point: gesture.origin,
|
||||
point: Vec.sub(gesture.origin, inputs.containerOffset),
|
||||
},
|
||||
event
|
||||
)
|
||||
@@ -75,7 +75,7 @@ export function useGestureEvents(ref: React.RefObject<HTMLDivElement>) {
|
||||
order: 0,
|
||||
delta: gesture.delta,
|
||||
offset: gesture.offset,
|
||||
point: gesture.origin,
|
||||
point: Vec.sub(gesture.origin, inputs.containerOffset),
|
||||
},
|
||||
event
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user