From 74957bc7e3ccd9635b502ece2231a94f5e0de2aa Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 26 Mar 2020 16:53:46 +0100 Subject: [PATCH] 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 --- pcbnew/footprint_edit_frame.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index d3882eac28..f425d85a85 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -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() ) );