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

Function drawNets

InteractiveHtmlBom/web/render.js:506–538  ·  view source on GitHub ↗
(canvas, layer, highlight)

Source from the content-addressed store, hash-verified

504}
505
506function drawNets(canvas, layer, highlight) {
507 var style = getComputedStyle(topmostdiv);
508 if (settings.renderZones) {
509 var zoneColor = style.getPropertyValue(highlight ? '--zone-color-highlight' : '--zone-color');
510 drawZones(canvas, layer, zoneColor, highlight);
511 }
512 if (settings.renderTracks) {
513 var trackColor = style.getPropertyValue(highlight ? '--track-color-highlight' : '--track-color');
514 drawTracks(canvas, layer, trackColor, highlight);
515 }
516 if (highlight && settings.renderPads) {
517 var padColor = style.getPropertyValue('--pad-color-highlight');
518 var padHoleColor = style.getPropertyValue('--pad-hole-color');
519 var ctx = canvas.getContext("2d");
520 for (var footprint of pcbdata.footprints) {
521 // draw pads
522 var padDrawn = false;
523 for (var pad of footprint.pads) {
524 if (highlightedNet != pad.net) continue;
525 if (pad.layers.includes(layer)) {
526 drawPad(ctx, pad, padColor, false);
527 padDrawn = true;
528 }
529 }
530 if (padDrawn) {
531 // redraw all pad holes because some pads may overlap
532 for (var pad of footprint.pads) {
533 drawPadHole(ctx, pad, padHoleColor);
534 }
535 }
536 }
537 }
538}
539
540function drawHighlightsOnLayer(canvasdict, clear = true) {
541 if (clear) {

Callers 2

drawHighlightsOnLayerFunction · 0.85
drawBackgroundFunction · 0.85

Calls 4

drawZonesFunction · 0.85
drawTracksFunction · 0.85
drawPadFunction · 0.85
drawPadHoleFunction · 0.85

Tested by

no test coverage detected