7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-03-30 06:56:57 +00:00

Don't disable first internal layer in footprint editor.

It's used as a proxy for all internal layers.

Also fixes LAYER_RANGE_ITERATOR so that it works with an odd
number of copper layers.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20246
This commit is contained in:
Jeff Young 2025-03-11 18:40:47 +00:00
parent a6fbf4bbdb
commit 459cf030b8
3 changed files with 9 additions and 3 deletions

View File

@ -703,7 +703,8 @@ LSET LSET::SideSpecificMask()
LSET LSET::ForbiddenFootprintLayers()
{
static const LSET saved = InternalCuMask();
static LSET saved = InternalCuMask();
saved.set( In1_Cu, false );
return saved;
}

View File

@ -82,7 +82,7 @@ private:
if( start & 1 || stop & 1 )
throw std::invalid_argument( "Only works for copper layers" );
m_layer_count = m_layer_count & ~1;
m_layer_count = m_layer_count;
if( stop == B_Cu || m_stop >= m_current )
m_reverse = false;

View File

@ -181,6 +181,12 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
// NOTE: KifaceSettings() will return PCBNEW_SETTINGS if we started from pcbnew
LoadSettings( GetSettings() );
// Enable one internal layer, because footprints support keepout areas that can be on
// internal layers only (therefore on the first internal layer). This is needed to handle
// these keepout in internal layers only.
GetBoard()->SetCopperLayerCount( 3 );
GetBoard()->SetLayerName( In1_Cu, _( "Inner layers" ) );
float proportion = GetFootprintEditorSettings()->m_AuiPanels.properties_splitter;
m_propertiesPanel->SetSplitterProportion( proportion );
@ -544,7 +550,6 @@ void FOOTPRINT_EDIT_FRAME::ReloadFootprint( FOOTPRINT* aFootprint )
// Don't drop pre-existing user layers
LSET enabledLayers = GetBoard()->GetEnabledLayers();
enabledLayers.set( In1_Cu ); // we've already done this, but it needs doing again :shrug:
aFootprint->RunOnDescendants(
[&]( BOARD_ITEM* child )