From 6e2ed5666daff4ee643f4e0e519f7390ebee9277 Mon Sep 17 00:00:00 2001 From: Dhineshkumar S Date: Mon, 28 Oct 2024 17:09:24 +0000 Subject: [PATCH] Fix Courtyard layers disappeared Currently, the used layers passed from parseLayers() do not include mandatory layers if they are missing in the loaded board file. To fix this, we can manually add the mandatory layers to ensure they are always enabled. Fixes https://gitlab.com/kicad/code/kicad/-/issues/18978 --- pcbnew/board_design_settings.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pcbnew/board_design_settings.cpp b/pcbnew/board_design_settings.cpp index 7d19677bd2..d7ea165a59 100644 --- a/pcbnew/board_design_settings.cpp +++ b/pcbnew/board_design_settings.cpp @@ -1432,8 +1432,11 @@ void BOARD_DESIGN_SETTINGS::SetCopperLayerCount( int aNewLayerCount ) void BOARD_DESIGN_SETTINGS::SetEnabledLayers( LSET aMask ) { - // Back and front layers are always enabled. - aMask.set( B_Cu ).set( F_Cu ); + // Ensures mandatory back and front layers are always enabled + // regardless of board file configuration. + aMask.set( B_Cu ).set( F_Cu ) + .set( B_CrtYd ).set( F_CrtYd ) + .set( Edge_Cuts ).set( Margin ); m_enabledLayers = aMask;