From 3e1a8c3c7ea0c9032810dfc6a9af44f32fc214ef Mon Sep 17 00:00:00 2001 From: Fabien Corona Date: Sat, 9 Nov 2019 12:43:01 +0100 Subject: [PATCH] High contrast color for holes in microvias and buried bias MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.17.1" This is a multi-part message in MIME format. --------------2.17.1 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit In high contrast mode, the holes of buried vias and microvias were no darkened when not on the active layer. Fixes: lp:1844982 * https://bugs.launchpad.net/kicad/+bug/1844982 --- pcbnew/pcb_painter.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) --------------2.17.1 Content-Type: text/x-patch; name="0001-High-contrast-color-for-holes-in-microvias-and-burie.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0001-High-contrast-color-for-holes-in-microvias-and-burie.patch" diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index b1839d404..97f217a11 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -252,6 +252,23 @@ const COLOR4D& PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer if( item->Type() == PCB_MARKER_T ) return m_layerColors[aLayer]; + + if( item->Type() == PCB_VIA_T ) + { + const VIA* via = static_cast( item ); + const BOARD* pcb = static_cast< const BOARD*>( item->GetParent() ); + + if( m_hiContrastEnabled ) + { + bool viaActiveLayer = false; + for( auto activeLayer : m_activeLayers ) + viaActiveLayer |= via->IsOnLayer( static_cast( activeLayer ) ) + && pcb->IsLayerVisible( static_cast( activeLayer ) ); + + if( !viaActiveLayer ) + return m_hiContrastColor[aLayer]; + } + } } // Single net highlight mode --------------2.17.1--