diff --git a/packages/tldraw/src/state/shapes/ArrowUtil/ArrowUtil.tsx b/packages/tldraw/src/state/shapes/ArrowUtil/ArrowUtil.tsx index 4e3d6ec55..e6d610c02 100644 --- a/packages/tldraw/src/state/shapes/ArrowUtil/ArrowUtil.tsx +++ b/packages/tldraw/src/state/shapes/ArrowUtil/ArrowUtil.tsx @@ -480,7 +480,7 @@ export class ArrowUtil extends TDShapeUtil { handlePoint = Vec.sub(hits[0], shape.point) } } else if (target.type === TDShapeType.Triangle) { - const points = getTrianglePoints(target, BINDING_DISTANCE).map((pt) => + const points = getTrianglePoints(target, BINDING_DISTANCE, target.rotation).map((pt) => Vec.add(pt, target.point) ) diff --git a/packages/tldraw/src/state/shapes/TriangleUtil/TriangleUtil.tsx b/packages/tldraw/src/state/shapes/TriangleUtil/TriangleUtil.tsx index b48c13ae3..b63f51d71 100644 --- a/packages/tldraw/src/state/shapes/TriangleUtil/TriangleUtil.tsx +++ b/packages/tldraw/src/state/shapes/TriangleUtil/TriangleUtil.tsx @@ -267,7 +267,7 @@ export class TriangleUtil extends TDShapeUtil { /* Helpers */ /* -------------------------------------------------- */ -export function getTrianglePoints(shape: T, offset = 0) { +export function getTrianglePoints(shape: T, offset = 0, rotation = 0) { const { size: [w, h], } = shape @@ -279,6 +279,7 @@ export function getTrianglePoints(shape: T, offset = 0) { ] if (offset) points = getOffsetPolygon(points, offset) + if (rotation) points = points.map((pt) => Vec.rotWith(pt, [w / 2, h / 2], rotation)) return points }