From 8943ec762b967e2b3a65e4123a6d8fd4f5cfc929 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Fri, 11 Aug 2023 15:05:59 +0200 Subject: [PATCH] fix(core): vertically or horizontally aligned nodes --- packages/core/src/components/Edges/utils/smoothstep.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/core/src/components/Edges/utils/smoothstep.ts b/packages/core/src/components/Edges/utils/smoothstep.ts index 1f44e42c..8d1df4d1 100644 --- a/packages/core/src/components/Edges/utils/smoothstep.ts +++ b/packages/core/src/components/Edges/utils/smoothstep.ts @@ -150,7 +150,13 @@ function getPoints({ centerY = points[0].y } - const pathPoints = [source, sourceGapped, ...points, targetGapped, target] + const pathPoints = [ + source, + { x: sourceGapped.x - sourceGapOffset.x, y: sourceGapped.y - sourceGapOffset.y }, + ...points, + { x: targetGapped.x - targetGapOffset.x, y: targetGapped.y - targetGapOffset.y }, + target, + ] return [pathPoints, centerX, centerY, defaultOffsetX, defaultOffsetY] }