Footprint editor: re-enable a internal copper layer to add/edit keep-out zones

on internal layers in footprints.

Fixes #4096
https://gitlab.com/kicad/code/kicad/issues/4096
This commit is contained in:
jean-pierre charras 2020-03-26 16:53:46 +01:00
parent 04d6ea982d
commit 74957bc7e3
1 changed files with 11 additions and 7 deletions

View File

@ -131,13 +131,6 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
SetBoard( new BOARD() );
// 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()->SetEnabledLayers( GetBoard()->GetEnabledLayers().set( In1_Cu ) );
GetBoard()->SetVisibleLayers( GetBoard()->GetEnabledLayers() );
GetBoard()->SetLayerName( In1_Cu, _( "Inner layers" ) );
// In modedit, the default net clearance is not known.
// (it depends on the actual board)
// So we do not show the default clearance, by setting it to 0
@ -167,6 +160,17 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
// initialize parameters in m_LayersManager
// NOTE: KifaceSettings() will return PCBNEW_SETTINGS if we started from pcbnew
LoadSettings( GetSettings() );
// Must be set after calling LoadSettings() to be sure these parameters are
// non dependent on what is read in stored settings.
// 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()->SetEnabledLayers( GetBoard()->GetEnabledLayers().set( In1_Cu ) );
GetBoard()->SetVisibleLayers( GetBoard()->GetEnabledLayers() );
GetBoard()->SetLayerName( In1_Cu, _( "Inner layers" ) );
GetGalDisplayOptions().m_axesEnabled = true;
SetScreen( new PCB_SCREEN( GetPageSettings().GetSizeIU() ) );