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

Function drawBgLayer

InteractiveHtmlBom/web/render.js:411–422  ·  view source on GitHub ↗
(layername, canvas, layer, scalefactor, edgeColor, polygonColor, textColor)

Source from the content-addressed store, hash-verified

409}
410
411function drawBgLayer(layername, canvas, layer, scalefactor, edgeColor, polygonColor, textColor) {
412 var ctx = canvas.getContext("2d");
413 for (var d of pcbdata.drawings[layername][layer]) {
414 if (["segment", "arc", "circle", "curve", "rect"].includes(d.type)) {
415 drawedge(ctx, scalefactor, d, edgeColor);
416 } else if (d.type == "polygon") {
417 drawPolygonShape(ctx, scalefactor, d, polygonColor);
418 } else {
419 drawText(ctx, d, textColor);
420 }
421 }
422}
423
424function drawTracks(canvas, layer, defaultColor, highlight) {
425 ctx = canvas.getContext("2d");

Callers 1

drawBackgroundFunction · 0.85

Calls 3

drawedgeFunction · 0.85
drawPolygonShapeFunction · 0.85
drawTextFunction · 0.85

Tested by

no test coverage detected