From 26b6d96e5e0e31bc6acbd85d5764a51986ed0a88 Mon Sep 17 00:00:00 2001 From: Mohamed Marrouchi Date: Fri, 4 Apr 2025 12:37:15 +0100 Subject: [PATCH] feat: add variable --- .../visual-editor/v2/AdvancedLink/AdvancedLinkFactory.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkFactory.tsx b/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkFactory.tsx index 58dd3df9..75132914 100644 --- a/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkFactory.tsx +++ b/frontend/src/components/visual-editor/v2/AdvancedLink/AdvancedLinkFactory.tsx @@ -33,6 +33,9 @@ const createBackwardCurvedPath = ( sourcePort: PortModel, targetPort: PortModel, ) => { + // Set a threshold for node proximity, below which dynamic adjustments to offsets are applied + // This helps in reducing abrupt curve steepness when nodes are close to each other + const proximityThreshold = 500; const sourceNode = sourcePort.getNode(); const targetNode = targetPort.getNode(); // **NEW:** Get port dimensions for better alignment @@ -110,7 +113,7 @@ const createBackwardCurvedPath = ( // If Node Distance is small, multiply offsets by overlap ratios // to avoid abrupt curve steepness - if (nodeDistance < 500) { + if (nodeDistance < proximityThreshold) { adjustedHorizontalOffset *= xOverlapRatio; adjustedVerticalOffset *= yOverlapRatio; }