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 1/2] 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" From 705bd71fddeb3aa25de9829cf4efe34657e5e8e3 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Wed, 25 Oct 2023 18:25:40 +0200 Subject: [PATCH 2/2] :recycle: Prefer not using webkit --- apps/builder/src/features/graph/components/Graph.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/builder/src/features/graph/components/Graph.tsx b/apps/builder/src/features/graph/components/Graph.tsx index 44a7f41191f..a24fa211530 100644 --- a/apps/builder/src/features/graph/components/Graph.tsx +++ b/apps/builder/src/features/graph/components/Graph.tsx @@ -244,11 +244,9 @@ 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', + perspective: 1000, + backfaceVisibility: 'hidden', + transformStyle: 'preserve-3d', }} willChange="transform" transformOrigin="0px 0px 0px"