MCPcopy Create free account
hub / github.com/openscopeproject/InteractiveHtmlBom / drawPad

Function drawPad

InteractiveHtmlBom/web/render.js:292–308  ·  view source on GitHub ↗
(ctx, pad, color, outline)

Source from the content-addressed store, hash-verified

290}
291
292function 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
310function drawPadHole(ctx, pad, padHoleColor) {
311 if (pad.type != "th") return;

Callers 2

drawFootprintFunction · 0.85
drawNetsFunction · 0.85

Calls 3

deg2radFunction · 0.85
getCachedPadPathFunction · 0.85
saveMethod · 0.80

Tested by

no test coverage detected