From 4710b709d9a71338e16339c7f811d5943f806104 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 5 Jan 2021 13:59:46 -0800 Subject: [PATCH] Only darken, don't hide vias unless requested Fixes https://gitlab.com/kicad/code/kicad/issues/6912 --- pcbnew/pcb_painter.cpp | 52 ++++-------------------------------------- 1 file changed, 5 insertions(+), 47 deletions(-) diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 65c2b12e3f..010b2fc193 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -348,11 +348,11 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons { if( item->Type() == PCB_VIA_T ) { - isActive = static_cast( item )->IsOnLayer( primary ); + isActive = static_cast( item )->FlashLayer( primary, true ); } else if( item->Type() == PCB_PAD_T ) { - isActive = static_cast( item )->IsOnLayer( primary ); + isActive = static_cast( item )->FlashLayer( primary, true ); } else if( item->Type() == PCB_TRACE_T || item->Type() == PCB_ARC_T ) { @@ -692,23 +692,6 @@ void PCB_PAINTER::draw( const VIA* aVia, int aLayer ) || ( aLayer == LAYER_VIA_BBLIND && aVia->GetViaType() == VIATYPE::BLIND_BURIED ) || ( aLayer == LAYER_VIA_MICROVIA && aVia->GetViaType() == VIATYPE::MICROVIA ) ) { - if( m_pcbSettings.GetHighContrast() ) - { - bool draw_annular = false; - - for( unsigned int layer : m_pcbSettings.GetHighContrastLayers() ) - { - if( aVia->FlashLayer( static_cast( layer ) , true ) ) - { - draw_annular = true; - break; - } - } - - if( !draw_annular ) - return; - } - radius = aVia->GetWidth() / 2.0; } else @@ -917,33 +900,6 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer ) // Pad drawing BOARD_DESIGN_SETTINGS& bds = aPad->GetBoard()->GetDesignSettings(); COLOR4D color = m_pcbSettings.GetColor( aPad, aLayer ); - bool draw_annular = true; - - if( aLayer == LAYER_PADS_TH - && aPad->GetSizeX() <= aPad->GetDrillSizeX() - && aPad->GetSizeY() <= aPad->GetDrillSizeY() ) - { - draw_annular = false; - } - else if( m_pcbSettings.GetHighContrast() ) - { - draw_annular = false; - - for( unsigned int layer : m_pcbSettings.GetHighContrastLayers() ) - { - if( aPad->FlashLayer( static_cast( layer ) , true ) ) - { - draw_annular = true; - break; - } - else if( !IsCopperLayer( layer ) ) - { - // If a non-copper layer is the high-contrast layer, just show the pad - draw_annular = true; - break; - } - } - } if( m_pcbSettings.m_sketchMode[LAYER_PADS_TH] ) { @@ -971,7 +927,9 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer ) else m_gal->DrawSegment( seg->GetSeg().A, seg->GetSeg().B, seg->GetWidth() ); } - else if( !draw_annular ) + else if( aLayer == LAYER_PADS_TH + && aPad->GetSizeX() <= aPad->GetDrillSizeX() + && aPad->GetSizeY() <= aPad->GetDrillSizeY() ) { // no annular ring to draw }