| 216 | } |
| 217 | |
| 218 | function drawArc( |
| 219 | ctx: CanvasRenderingContext2D, |
| 220 | element: ArcElement, |
| 221 | offset: number, |
| 222 | spacing: number, |
| 223 | circular: boolean, |
| 224 | ) { |
| 225 | const {fullCircles, startAngle, circumference} = element; |
| 226 | let endAngle = element.endAngle; |
| 227 | if (fullCircles) { |
| 228 | pathArc(ctx, element, offset, spacing, endAngle, circular); |
| 229 | for (let i = 0; i < fullCircles; ++i) { |
| 230 | ctx.fill(); |
| 231 | } |
| 232 | if (!isNaN(circumference)) { |
| 233 | endAngle = startAngle + (circumference % TAU || TAU); |
| 234 | } |
| 235 | } |
| 236 | pathArc(ctx, element, offset, spacing, endAngle, circular); |
| 237 | ctx.fill(); |
| 238 | return endAngle; |
| 239 | } |
| 240 | |
| 241 | function drawBorder( |
| 242 | ctx: CanvasRenderingContext2D, |