From 08db332b752585e99d757075e1b747376260c214 Mon Sep 17 00:00:00 2001 From: Shahidullah Muffakir Date: Wed, 7 Feb 2024 17:15:05 +0530 Subject: [PATCH] Revert redundant Graph zoom code, only onUpdate handler is enough --- src/store/useGraph.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/store/useGraph.ts b/src/store/useGraph.ts index bc5737ee8e1..075744f91ac 100644 --- a/src/store/useGraph.ts +++ b/src/store/useGraph.ts @@ -194,17 +194,14 @@ const useGraph = create((set, get) => ({ setZoomFactor: zoomFactor => { const viewPort = get().viewPort; viewPort?.camera?.recenter(viewPort.centerX, viewPort.centerY, zoomFactor); - set({ viewPort }); }, zoomIn: () => { const viewPort = get().viewPort; viewPort?.camera?.recenter(viewPort.centerX, viewPort.centerY, viewPort.zoomFactor + 0.1); - set({viewPort}) }, zoomOut: () => { const viewPort = get().viewPort; viewPort?.camera?.recenter(viewPort.centerX, viewPort.centerY, viewPort.zoomFactor - 0.1); - set({ viewPort }); }, centerView: () => { const viewPort = get().viewPort; @@ -214,7 +211,6 @@ const useGraph = create((set, get) => ({ if (canvas) { viewPort?.camera?.centerFitElementIntoView(canvas); } - set({ viewPort }); }, toggleFullscreen: fullscreen => set({ fullscreen }), setViewPort: viewPort => set({ viewPort }),