From 190197794db54deab72321836454ec1803d16a02 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 27 Nov 2020 22:30:35 +0000 Subject: [PATCH] Apply a similar fix as pads for B&W via printing. Fixes https://gitlab.com/kicad/code/kicad/issues/6496 --- pcbnew/pcb_painter.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 6de373f0cd..a667a97987 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -249,10 +249,25 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons bool hasAnnularRing = pad->GetSizeX() > pad->GetDrillSizeX() && pad->GetSizeY() > pad->GetDrillSizeY(); - if( !hasAnnularRing && m_layerColors[aLayer] == m_layerColors[LAYER_PCB_BACKGROUND] ) + if( !hasAnnularRing && m_layerColors[ aLayer ] == m_layerColors[ LAYER_PCB_BACKGROUND ] ) aLayer = LAYER_MOD_TEXT_INVISIBLE; - if( hasAnnularRing && m_layerColors[aLayer] == m_layerColors[LAYER_PADS_TH] ) + if( hasAnnularRing && m_layerColors[ aLayer ] == m_layerColors[ LAYER_PADS_TH ] ) + aLayer = LAYER_PCB_BACKGROUND; + } + else if( aLayer == LAYER_VIAS_HOLES ) + { + const VIA* via = static_cast( item ); + int annularRingLayer; + + if( via->GetViaType() == VIATYPE::MICROVIA ) + annularRingLayer = LAYER_VIA_MICROVIA; + else if( via->GetViaType() == VIATYPE::BLIND_BURIED ) + annularRingLayer = LAYER_VIA_BBLIND; + else + annularRingLayer = LAYER_VIA_THROUGH; + + if( m_layerColors[ aLayer ] == m_layerColors[ annularRingLayer ] ) aLayer = LAYER_PCB_BACKGROUND; }