@@ -417,21 +417,16 @@ function drawBgLayer(layername, canvas, layer, scalefactor, edgeColor, polygonCo
417
417
function drawTracks ( canvas , layer , defaultColor , highlight ) {
418
418
ctx = canvas . getContext ( "2d" ) ;
419
419
ctx . lineCap = "round" ;
420
+
421
+ var hasHole = ( track ) => (
422
+ 'drillsize' in track &&
423
+ track . start [ 0 ] == track . end [ 0 ] &&
424
+ track . start [ 1 ] == track . end [ 1 ] ) ;
425
+
426
+ // First draw tracks and tented vias
420
427
for ( var track of pcbdata . tracks [ layer ] ) {
421
428
if ( highlight && highlightedNet != track . net ) continue ;
422
- if ( 'drillsize' in track && track . start [ 0 ] == track . end [ 0 ] && track . start [ 1 ] == track . end [ 1 ] ) {
423
- var style = getComputedStyle ( topmostdiv ) ;
424
- ctx . strokeStyle = highlight ? defaultColor : settings . netColors [ track . net ] || defaultColor ;
425
- ctx . lineWidth = track . width ;
426
- ctx . beginPath ( ) ;
427
- ctx . moveTo ( ...track . start ) ;
428
- ctx . lineTo ( ...track . end ) ;
429
- ctx . stroke ( ) ;
430
- ctx . strokeStyle = style . getPropertyValue ( '--pad-hole-color' ) ;
431
- ctx . lineWidth = track . drillsize ;
432
- ctx . lineTo ( ...track . end ) ;
433
- ctx . stroke ( ) ;
434
- } else {
429
+ if ( ! hasHole ( track ) ) {
435
430
ctx . strokeStyle = highlight ? defaultColor : settings . netColors [ track . net ] || defaultColor ;
436
431
ctx . lineWidth = track . width ;
437
432
ctx . beginPath ( ) ;
@@ -448,6 +443,25 @@ function drawTracks(canvas, layer, defaultColor, highlight) {
448
443
ctx . stroke ( ) ;
449
444
}
450
445
}
446
+ // Second pass to draw untented vias
447
+ var style = getComputedStyle ( topmostdiv ) ;
448
+ var holeColor = style . getPropertyValue ( '--pad-hole-color' )
449
+
450
+ for ( var track of pcbdata . tracks [ layer ] ) {
451
+ if ( highlight && highlightedNet != track . net ) continue ;
452
+ if ( hasHole ( track ) ) {
453
+ ctx . strokeStyle = highlight ? defaultColor : settings . netColors [ track . net ] || defaultColor ;
454
+ ctx . lineWidth = track . width ;
455
+ ctx . beginPath ( ) ;
456
+ ctx . moveTo ( ...track . start ) ;
457
+ ctx . lineTo ( ...track . end ) ;
458
+ ctx . stroke ( ) ;
459
+ ctx . strokeStyle = holeColor ;
460
+ ctx . lineWidth = track . drillsize ;
461
+ ctx . lineTo ( ...track . end ) ;
462
+ ctx . stroke ( ) ;
463
+ }
464
+ }
451
465
}
452
466
453
467
function drawZones ( canvas , layer , defaultColor , highlight ) {
0 commit comments