Fix corners

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Mark Tolmacs 2025-04-24 21:15:11 +02:00
parent 043c95fcc0
commit 7d2253b75f
No known key found for this signature in database

View file

@ -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),