From a141d05e87a23271b92dfa4d9657c0ac2c7f3ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cchrisshank=E2=80=9D?= Date: Sat, 7 Dec 2024 12:49:41 -0800 Subject: [PATCH] fix rope --- src/folk-rope.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/folk-rope.ts b/src/folk-rope.ts index 1798431..5bcfda6 100644 --- a/src/folk-rope.ts +++ b/src/folk-rope.ts @@ -125,7 +125,7 @@ export class FolkRope extends FolkBaseConnection { let target: Point; if (sourceRect instanceof DOMRectTransform) { - source = Vector.lerp(sourceRect.bottomRight, sourceRect.bottomLeft, 0.5); + source = sourceRect.toParentSpace({ x: sourceRect.width / 2, y: sourceRect.height }); } else { source = { x: sourceRect.x + sourceRect.width / 2, @@ -134,7 +134,7 @@ export class FolkRope extends FolkBaseConnection { } if (targetRect instanceof DOMRectTransform) { - target = Vector.lerp(targetRect.bottomRight, targetRect.bottomLeft, 0.5); + target = targetRect.toParentSpace({ x: targetRect.width / 2, y: targetRect.height }); } else { target = { x: targetRect.x + targetRect.width / 2,