feat: add variable

This commit is contained in:
Mohamed Marrouchi 2025-04-04 12:37:15 +01:00
parent 74470ef8b8
commit 26b6d96e5e

View File

@ -33,6 +33,9 @@ const createBackwardCurvedPath = (
sourcePort: PortModel, sourcePort: PortModel,
targetPort: 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 sourceNode = sourcePort.getNode();
const targetNode = targetPort.getNode(); const targetNode = targetPort.getNode();
// **NEW:** Get port dimensions for better alignment // **NEW:** Get port dimensions for better alignment
@ -110,7 +113,7 @@ const createBackwardCurvedPath = (
// If Node Distance is small, multiply offsets by overlap ratios // If Node Distance is small, multiply offsets by overlap ratios
// to avoid abrupt curve steepness // to avoid abrupt curve steepness
if (nodeDistance < 500) { if (nodeDistance < proximityThreshold) {
adjustedHorizontalOffset *= xOverlapRatio; adjustedHorizontalOffset *= xOverlapRatio;
adjustedVerticalOffset *= yOverlapRatio; adjustedVerticalOffset *= yOverlapRatio;
} }