Function
drawArrow
(
context: CanvasRenderingContext2D | Path2D,
center: Vector2,
tangent: Vector2,
arrowSize: number,
)
Source from the content-addressed store, hash-verified
| 438 | } |
| 439 | |
| 440 | private drawArrow( |
| 441 | context: CanvasRenderingContext2D | Path2D, |
| 442 | center: Vector2, |
| 443 | tangent: Vector2, |
| 444 | arrowSize: number, |
| 445 | ) { |
| 446 | const normal = tangent.perpendicular; |
| 447 | const origin = center.add(tangent.scale(-arrowSize / 2)); |
| 448 | |
| 449 | moveTo(context, origin); |
| 450 | lineTo(context, origin.add(tangent.add(normal).scale(arrowSize))); |
| 451 | lineTo(context, origin.add(tangent.sub(normal).scale(arrowSize))); |
| 452 | lineTo(context, origin); |
| 453 | context.closePath(); |
| 454 | } |
| 455 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected