fix(app.tsx): use cursorx, cursory in onGestureChange as pointers are empty (#2424)

This commit is contained in:
Aakansha Doshi 2020-11-30 06:00:13 +05:30 committed by GitHub
parent bdb1fb2dae
commit 084aff2bf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1735,12 +1735,11 @@ class App extends React.Component<ExcalidrawProps, AppState> {
private onGestureChange = withBatchedUpdates((event: GestureEvent) => {
event.preventDefault();
const gestureCenter = getCenter(gesture.pointers);
this.setState(({ zoom }) => ({
zoom: getNewZoom(
getNormalizedZoom(gesture.initialScale! * event.scale),
zoom,
gestureCenter,
{ x: cursorX, y: cursorY },
),
}));
});