From 7d2253b75f51b26296e75ce812260b9190dde043 Mon Sep 17 00:00:00 2001 From: Mark Tolmacs Date: Thu, 24 Apr 2025 21:15:11 +0200 Subject: [PATCH] Fix corners Signed-off-by: Mark Tolmacs --- packages/excalidraw/renderer/interactiveScene.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/excalidraw/renderer/interactiveScene.ts b/packages/excalidraw/renderer/interactiveScene.ts index 4a084e231e..419a315f32 100644 --- a/packages/excalidraw/renderer/interactiveScene.ts +++ b/packages/excalidraw/renderer/interactiveScene.ts @@ -207,7 +207,7 @@ const strokeDiamondWithRotation = ( context.save(); context.translate(x, y); context.rotate(element.angle); - padding = 45; + { context.beginPath(); @@ -215,10 +215,10 @@ const strokeDiamondWithRotation = ( getDiamondPoints(element); const verticalRadius = element.roundness ? getCornerRadius(Math.abs(topX - leftX), element) - : 1; + : (topX - leftX) * 0.01; const horizontalRadius = element.roundness ? getCornerRadius(Math.abs(rightY - topY), element) - : 1; + : (rightY - topY) * 0.01; const topApprox = offsetBezier( pointFrom(topX - verticalRadius, topY + horizontalRadius), pointFrom(topX, topY), @@ -270,10 +270,10 @@ const strokeDiamondWithRotation = ( getDiamondPoints(element); const verticalRadius = element.roundness ? getCornerRadius(Math.abs(topX - leftX), element) - : 1; + : (topX - leftX) * 0.01; const horizontalRadius = element.roundness ? getCornerRadius(Math.abs(rightY - topY), element) - : 1; + : (rightY - topY) * 0.01; const topApprox = offsetBezier( pointFrom(topX + verticalRadius, topY + horizontalRadius), pointFrom(topX, topY),