From d478974e0dba9124acee0907d3cf1c94042ef5b7 Mon Sep 17 00:00:00 2001 From: Mark Tolmacs Date: Wed, 23 Apr 2025 16:14:53 +0200 Subject: [PATCH] Fix #2 on diamond corners Signed-off-by: Mark Tolmacs --- packages/element/src/binding.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/element/src/binding.ts b/packages/element/src/binding.ts index bb6d1bc86f..f480d7fd9c 100644 --- a/packages/element/src/binding.ts +++ b/packages/element/src/binding.ts @@ -1131,7 +1131,7 @@ export const snapToMid = ( ); } else if ( element.type === "diamond" - ? nonRotated[0] >= x + width * (element.roundness ? 0.035 : 1) + ? nonRotated[0] >= x + width * (element.roundness ? 1 - 0.035 : 1) : nonRotated[0] >= x + width / 2 && nonRotated[1] > center[1] - verticalThrehsold && nonRotated[1] < center[1] + verticalThrehsold @@ -1144,7 +1144,7 @@ export const snapToMid = ( ); } else if ( element.type === "diamond" - ? nonRotated[1] >= y - height * (element.roundness ? 0.035 : 1) + ? nonRotated[1] >= y + height * (element.roundness ? 1 - 0.035 : 1) : nonRotated[1] >= y + height / 2 && nonRotated[0] > center[0] - horizontalThrehsold && nonRotated[0] < center[0] + horizontalThrehsold