From 35b0f33a4461b3417e1f93c24916f0d52a30cd64 Mon Sep 17 00:00:00 2001 From: Fabien Corona Date: Sun, 17 Nov 2019 10:34:33 +0100 Subject: [PATCH] pcbnew: Via netnames visibility 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 Enabled the high contrast mode for via netnames Do not display a via netname if the via is not on any visible layer Fixes: lp:1852899 * https://bugs.launchpad.net/kicad/+bug/1852899 --- pcbnew/class_track.cpp | 10 ++++------ pcbnew/pcb_painter.cpp | 3 ++- 2 files changed, 6 insertions(+), 7 deletions(-) --------------2.17.1 Content-Type: text/x-patch; name="0001-pcbnew-Via-netnames-visibility.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0001-pcbnew-Via-netnames-visibility.patch" diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index 949751bff..08ecdc296 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -729,18 +729,16 @@ void VIA::ViewGetLayers( int aLayers[], int& aCount ) const unsigned int VIA::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const { constexpr unsigned int HIDE = std::numeric_limits::max(); - - // Netnames will be shown only if zoom is appropriate - if( IsNetnameLayer( aLayer ) ) - return m_Width == 0 ? HIDE : ( Millimeter2iu( 10 ) / m_Width ); - - BOARD* board = GetBoard(); // Only draw the via if at least one of the layers it crosses is being displayed if( board && ( board->GetVisibleLayers() & GetLayerSet() ).any() && aView->IsLayerVisible( LAYER_VIAS ) ) { + // Netnames will be shown only if zoom is appropriate + if( IsNetnameLayer( aLayer ) ) + return m_Width == 0 ? HIDE : ( Millimeter2iu( 10 ) / m_Width ); + switch( m_ViaType ) { case VIA_THROUGH: diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index d3933e70f..19559546d 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -258,7 +258,8 @@ const COLOR4D& PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ( aLayer == LAYER_VIAS_HOLES || aLayer == LAYER_VIA_THROUGH || aLayer == LAYER_VIA_MICROVIA || - aLayer == LAYER_VIA_BBLIND ) ) + aLayer == LAYER_VIA_BBLIND || + aLayer == LAYER_VIAS_NETNAMES ) ) { const VIA* via = static_cast( item ); const BOARD* pcb = static_cast( item->GetParent() ); --------------2.17.1--