Fix logic that's been broken for 11 years.

(And was doubly-broken when copper layers went to
even numbers only.)
This commit is contained in:
Jeff Young 2025-06-06 10:41:33 +01:00
parent b94f5a013a
commit 863d3c3603

View File

@ -424,16 +424,16 @@ bool LAYERS_MAP_DIALOG::TransferDataFromWindow()
for( int ii = 0; ii < GERBER_DRAWLAYERS_COUNT; ++ii )
{
if( m_layersLookUpTable[ii] < F_Cu )
if( IsInnerCopperLayer( m_layersLookUpTable[ii] ) )
{
if( m_layersLookUpTable[ii ] > inner_layer_max )
inner_layer_max = m_layersLookUpTable[ii];
}
}
// inner_layer_max must be less than (or equal to the number of internal copper layers
// inner_layer_max must be less than or equal to the number of internal copper layers
// internal copper layers = m_exportBoardCopperLayersCount-2
if( inner_layer_max > m_exportBoardCopperLayersCount-2 )
if( (int) CopperLayerToOrdinal( ToLAYER_ID( inner_layer_max ) ) > m_exportBoardCopperLayersCount-2 )
{
wxMessageBox( _( "Exported board does not have enough copper layers to handle selected "
"inner layers" ) );