(ctx, pad, color, outline)
| 290 | } |
| 291 | |
| 292 | function drawPad(ctx, pad, color, outline) { |
| 293 | ctx.save(); |
| 294 | ctx.translate(...pad.pos); |
| 295 | ctx.rotate(-deg2rad(pad.angle)); |
| 296 | if (pad.offset) { |
| 297 | ctx.translate(...pad.offset); |
| 298 | } |
| 299 | ctx.fillStyle = color; |
| 300 | ctx.strokeStyle = color; |
| 301 | var path = getCachedPadPath(pad); |
| 302 | if (outline) { |
| 303 | ctx.stroke(path); |
| 304 | } else { |
| 305 | ctx.fill(path); |
| 306 | } |
| 307 | ctx.restore(); |
| 308 | } |
| 309 | |
| 310 | function drawPadHole(ctx, pad, padHoleColor) { |
| 311 | if (pad.type != "th") return; |
no test coverage detected