From 777f232c66ec12dd82e293f5c28eefb40557e519 Mon Sep 17 00:00:00 2001 From: neo773 <62795688+neo773@users.noreply.github.com> Date: Mon, 23 Oct 2023 01:48:26 +0530 Subject: [PATCH] fix graph flickering & performance improvments --- apps/builder/src/features/graph/components/Graph.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/builder/src/features/graph/components/Graph.tsx b/apps/builder/src/features/graph/components/Graph.tsx index 4ce3835509f..44a7f41191f 100644 --- a/apps/builder/src/features/graph/components/Graph.tsx +++ b/apps/builder/src/features/graph/components/Graph.tsx @@ -174,7 +174,9 @@ export const Graph = ({ let newScale = graphPosition.scale + (delta ?? 0) if (scale) { const scaleDiff = scale - graphPosition.scale - newScale += Math.min(zoomButtonsScaleBlock, Math.abs(scaleDiff)) * Math.sign(scaleDiff) + newScale += + Math.min(zoomButtonsScaleBlock, Math.abs(scaleDiff)) * + Math.sign(scaleDiff) } if ( @@ -242,6 +244,11 @@ export const Graph = ({ data-testid="graph" style={{ transform, + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + '-webkit-perspective': 1000, + '-webkit-backface-visibility': 'hidden', + '-webkit-transform-style': 'preserve-3d', }} willChange="transform" transformOrigin="0px 0px 0px"