Explorar o código

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

Aakansha Doshi %!s(int64=4) %!d(string=hai) anos
pai
achega
084aff2bf3
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      src/components/App.tsx

+ 1 - 2
src/components/App.tsx

@@ -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 },
       ),
     }));
   });