diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index e5fb025f30..b59eb5efd9 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -1705,29 +1705,17 @@ bool SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOn case PCB_ZONE_AREA_T: case PCB_MODULE_ZONE_AREA_T: { + const ZONE_CONTAINER* zone = static_cast( aItem ); + // Check to see if this keepout is part of a footprint // If it is, and we are not editing the footprint, it should not be selectable - const bool zoneInFootprint = - aItem->GetParent() != nullptr && aItem->GetParent()->Type() == PCB_MODULE_T; + bool zoneInFootprint = zone->GetParent() && zone->GetParent()->Type() == PCB_MODULE_T; + if( zoneInFootprint && !m_editModules && !checkVisibilityOnly ) return false; // zones can exist on multiple layers! - { - auto* zone = static_cast( aItem ); - auto zoneLayers = zone->GetLayerSet().Seq(); - - for( unsigned int i = 0; i < zoneLayers.size(); i++ ) - { - if( board()->IsLayerVisible( zoneLayers[i] ) ) - { - return true; - } - } - - // No active layers selected! - return false; - } + return ( zone->GetLayerSet() & board()->GetVisibleLayers() ).any(); } break; diff --git a/pcbnew/zone_settings.cpp b/pcbnew/zone_settings.cpp index 0147ea4e6c..5e4d1623fc 100644 --- a/pcbnew/zone_settings.cpp +++ b/pcbnew/zone_settings.cpp @@ -195,6 +195,9 @@ void ZONE_SETTINGS::SetupLayersList( wxDataViewListCtrl* aList, PCB_BASE_FRAME* LSET layers = aShowCopper ? LSET::AllCuMask( board->GetCopperLayerCount() ) : LSET::AllNonCuMask(); + if( aFpEditorMode ) + layers.set( In1_Cu ); // a proxy for "all inner layers" + wxDataViewColumn* checkColumn = aList->AppendToggleColumn( wxEmptyString ); wxDataViewColumn* layerColumn = aList->AppendIconTextColumn( wxEmptyString ); wxDataViewColumn* layerIDColumn = aList->AppendTextColumn( wxEmptyString ); @@ -206,6 +209,7 @@ void ZONE_SETTINGS::SetupLayersList( wxDataViewListCtrl* aList, PCB_BASE_FRAME* { PCB_LAYER_ID layerID = *layer; wxString layerName = board->GetLayerName( layerID ); + if( aFpEditorMode && layerID == In1_Cu ) layerName = _( "Inner layers" );