Do not draw pads on hidden copper layers.

This commit is contained in:
Andrzej Wolski 2018-02-17 23:53:44 +01:00 committed by Wayne Stambaugh
parent 4c19606eb7
commit 370232f70d
2 changed files with 7 additions and 0 deletions

View File

@ -1276,6 +1276,7 @@ void D_PAD::ViewGetLayers( int aLayers[], int& aCount ) const
unsigned int D_PAD::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const unsigned int D_PAD::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
{ {
const int HIDE = std::numeric_limits<unsigned int>::max(); const int HIDE = std::numeric_limits<unsigned int>::max();
BOARD* board = GetBoard();
// Handle Render tab switches // Handle Render tab switches
if( ( GetAttribute() == PAD_ATTRIB_STANDARD || GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED ) if( ( GetAttribute() == PAD_ATTRIB_STANDARD || GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED )
@ -1294,6 +1295,10 @@ unsigned int D_PAD::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
if( IsBackLayer( ( PCB_LAYER_ID )aLayer ) && !aView->IsLayerVisible( LAYER_PAD_BK ) ) if( IsBackLayer( ( PCB_LAYER_ID )aLayer ) && !aView->IsLayerVisible( LAYER_PAD_BK ) )
return HIDE; return HIDE;
// Only draw the pad if at least one of the layers it crosses is being displayed
if( board && !( board->GetVisibleLayers() & GetLayerSet() ).any() )
return HIDE;
// Netnames will be shown only if zoom is appropriate // Netnames will be shown only if zoom is appropriate
if( IsNetnameLayer( aLayer ) ) if( IsNetnameLayer( aLayer ) )
{ {

View File

@ -446,10 +446,12 @@ void PCB_DRAW_PANEL_GAL::setDefaultLayerDeps()
m_view->SetRequired( LAYER_PADS_NETNAMES, LAYER_PADS_TH ); m_view->SetRequired( LAYER_PADS_NETNAMES, LAYER_PADS_TH );
// Front modules // Front modules
m_view->SetRequired( LAYER_PAD_FR, F_Cu );
m_view->SetRequired( LAYER_MOD_TEXT_FR, LAYER_MOD_FR ); m_view->SetRequired( LAYER_MOD_TEXT_FR, LAYER_MOD_FR );
m_view->SetRequired( LAYER_PAD_FR_NETNAMES, LAYER_PAD_FR ); m_view->SetRequired( LAYER_PAD_FR_NETNAMES, LAYER_PAD_FR );
// Back modules // Back modules
m_view->SetRequired( LAYER_PAD_BK, B_Cu );
m_view->SetRequired( LAYER_MOD_TEXT_BK, LAYER_MOD_BK ); m_view->SetRequired( LAYER_MOD_TEXT_BK, LAYER_MOD_BK );
m_view->SetRequired( LAYER_PAD_BK_NETNAMES, LAYER_PAD_BK ); m_view->SetRequired( LAYER_PAD_BK_NETNAMES, LAYER_PAD_BK );