From 675444a646409cf728feaec34583c36be04eed62 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 10 Apr 2021 22:37:56 +0100 Subject: [PATCH] Dim hole walls that don't pass through high-contrast layers. Fixes https://gitlab.com/kicad/code/kicad/issues/8144 --- pcbnew/pcb_painter.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index f191aaece4..3609eca76d 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -347,6 +347,24 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons if( !static_cast( item )->FlashLayer( primary ) ) isActive = false; } + else if( IsHoleLayer( originalLayer ) ) + { + const VIA* via = static_cast( item ); + VIATYPE viaType = via ? via->GetViaType() : VIATYPE::NOT_DEFINED; + + if( via && ( viaType == VIATYPE::BLIND_BURIED || viaType == VIATYPE::MICROVIA ) ) + { + // A blind or micro via's hole is active if it crosses the primary layer + if( via->GetLayerSet().test( primary ) == 0 ) + isActive = false; + } + else + { + // A through via or pad's hole is active if any physical layer is active + if( LSET::PhysicalLayersMask().test( primary ) == 0 ) + isActive = false; + } + } if( !isActive ) {