From 36a2fab953ec7a40f2ccd175695fcc95b3bae57b Mon Sep 17 00:00:00 2001 From: Faton Ramadani Date: Wed, 14 Aug 2024 13:22:53 +0200 Subject: [PATCH] feat(frontend): fix viewport --- frontend/src/lib/components/graph/FlowGraphV2.svelte | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/components/graph/FlowGraphV2.svelte b/frontend/src/lib/components/graph/FlowGraphV2.svelte index 26508d34d2..3732ede470 100644 --- a/frontend/src/lib/components/graph/FlowGraphV2.svelte +++ b/frontend/src/lib/components/graph/FlowGraphV2.svelte @@ -116,7 +116,8 @@ des.x + (fullSize ? fullWidth : width) / 2 - boxSize.width / 2 - - NODE.width / 2 + NODE.width / 2 - + (width - fullWidth) / 2 : 0, y: des.y || 0 } @@ -229,7 +230,7 @@ const viewport = writable({ x: 0, - y: 1000, + y: 0, zoom: 1 }) @@ -251,10 +252,10 @@ {edgeTypes} {nodeTypes} {viewport} + {height} minZoom={0.5} connectionLineType={ConnectionLineType.SmoothStep} defaultEdgeOptions={{ type: 'smoothstep' }} - fitView preventScrolling={scroll} {proOptions} nodesDraggable={false}