fix(app.tsx): use cursorx, cursory in onGestureChange as pointers are empty (#2424)
This commit is contained in:
parent
bdb1fb2dae
commit
084aff2bf3
@ -1735,12 +1735,11 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||||||
|
|
||||||
private onGestureChange = withBatchedUpdates((event: GestureEvent) => {
|
private onGestureChange = withBatchedUpdates((event: GestureEvent) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const gestureCenter = getCenter(gesture.pointers);
|
|
||||||
this.setState(({ zoom }) => ({
|
this.setState(({ zoom }) => ({
|
||||||
zoom: getNewZoom(
|
zoom: getNewZoom(
|
||||||
getNormalizedZoom(gesture.initialScale! * event.scale),
|
getNormalizedZoom(gesture.initialScale! * event.scale),
|
||||||
zoom,
|
zoom,
|
||||||
gestureCenter,
|
{ x: cursorX, y: cursorY },
|
||||||
),
|
),
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user