7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-04 23:05:30 +00:00

Fix Eagle PCB layers handling after v9 layer changes.

(cherry picked from commit 2bf369793c)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
This commit is contained in:
dsa-t 2025-03-13 17:48:56 +03:00
parent f3f9730f2c
commit 18b5046fae

View File

@ -623,7 +623,7 @@ void PCB_IO_EAGLE::loadLayerDefs( wxXmlNode* aLayers )
else
{
// some eagle boards do not have contiguous layer number sequences.
m_cu_map[it->number] = ki_layer_count;
m_cu_map[it->number] = BoardLayerFromLegacyId( ki_layer_count );
}
}
@ -3330,9 +3330,13 @@ int PCB_IO_EAGLE::getMinimumCopperLayerCount() const
{
PCB_LAYER_ID layerId = it->second;
if( IsCopperLayer( layerId ) && layerId != F_Cu && layerId != B_Cu
&& ( layerId + 2 ) > minLayerCount )
minLayerCount = layerId + 2;
if( !IsCopperLayer( layerId ) || layerId == F_Cu || layerId == B_Cu )
continue;
int ordinal = CopperLayerToOrdinal( layerId );
if( ( ordinal + 2 ) > minLayerCount )
minLayerCount = ordinal + 2;
}
// Ensure the copper layers count is a multiple of 2