(ctx: CanvasRenderingContext2D, size: number, radius: number)
| 2458 | |
| 2459 | // Draw rounded square |
| 2460 | const drawRoundedSquare = (ctx: CanvasRenderingContext2D, size: number, radius: number) => { |
| 2461 | const half = size * 0.7; |
| 2462 | const r = Math.min(radius, half); |
| 2463 | ctx.beginPath(); |
| 2464 | ctx.moveTo(-half + r, -half); |
| 2465 | ctx.lineTo(half - r, -half); |
| 2466 | ctx.quadraticCurveTo(half, -half, half, -half + r); |
| 2467 | ctx.lineTo(half, half - r); |
| 2468 | ctx.quadraticCurveTo(half, half, half - r, half); |
| 2469 | ctx.lineTo(-half + r, half); |
| 2470 | ctx.quadraticCurveTo(-half, half, -half, half - r); |
| 2471 | ctx.lineTo(-half, -half + r); |
| 2472 | ctx.quadraticCurveTo(-half, -half, -half + r, -half); |
| 2473 | ctx.closePath(); |
| 2474 | }; |
| 2475 | |
| 2476 | // Draw a single particle (blue - regular, fades) |
| 2477 | const drawParticle = (ctx: CanvasRenderingContext2D, p: Particle) => { |
no outgoing calls
no test coverage detected