@@ -417,21 +417,16 @@ function drawBgLayer(layername, canvas, layer, scalefactor, edgeColor, polygonCo
417417function  drawTracks ( canvas ,  layer ,  defaultColor ,  highlight )  { 
418418  ctx  =  canvas . getContext ( "2d" ) ; 
419419  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 
420427  for  ( var  track  of  pcbdata . tracks [ layer ] )  { 
421428    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 ) )  { 
435430      ctx . strokeStyle  =  highlight  ? defaultColor  : settings . netColors [ track . net ]  ||  defaultColor ; 
436431      ctx . lineWidth  =  track . width ; 
437432      ctx . beginPath ( ) ; 
@@ -448,6 +443,25 @@ function drawTracks(canvas, layer, defaultColor, highlight) {
448443      ctx . stroke ( ) ; 
449444    } 
450445  } 
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+   } 
451465} 
452466
453467function  drawZones ( canvas ,  layer ,  defaultColor ,  highlight )  { 
0 commit comments