Handle hidden layers in FP Editor.

Fixes https://gitlab.com/kicad/code/kicad/issues/10946
This commit is contained in:
Jeff Young 2022-02-23 15:30:38 +00:00
parent 6e35406015
commit 08df5c0b01
1 changed files with 9 additions and 2 deletions

View File

@ -220,7 +220,7 @@ PCB_LAYER_ID PAD::GetPrincipalLayer() const
bool PAD::FlashLayer( LSET aLayers ) const
{
for( auto layer : aLayers.Seq() )
for( PCB_LAYER_ID layer : aLayers.Seq() )
{
if( FlashLayer( layer ) )
return true;
@ -1319,7 +1319,14 @@ double PAD::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
// Handle board visibility
if( board )
visible = board->GetVisibleLayers() & board->GetEnabledLayers();
visible &= board->GetEnabledLayers();
// Handle view visibility
for( int layer = 0; layer < PCB_LAYER_ID_COUNT; ++layer )
{
if( !aView->IsLayerVisible( layer ) )
visible.set( layer, false );
}
// Handle Render tab switches
if( ( GetAttribute() == PAD_ATTRIB::PTH || GetAttribute() == PAD_ATTRIB::NPTH )