Skip to content

Commit

Permalink
fix graph flickering & performance improvments
Browse files Browse the repository at this point in the history
  • Loading branch information
neo773 committed Oct 22, 2023
1 parent eba52a5 commit 777f232
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion apps/builder/src/features/graph/components/Graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 777f232

Please sign in to comment.