Fabmaster: map layers in the v9 way

In the layer_order vector, the first is F_Cu, the last is
B_Cu, and everything else increments in steps of two.

The file in #19174's file showed this problem, but it's not
unique to that one, and it's a separate 8.99 issue.

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/19174
This commit is contained in:
John Beard 2024-11-24 14:35:44 +08:00
parent 4d2d70ce22
commit 02c4cab224

View File

@ -779,14 +779,17 @@ bool FABMASTER::assignLayers()
}
std::sort( layer_order.begin(), layer_order.end(), FABMASTER_LAYER::BY_ID() );
int layernum = 0;
for( auto layer : layer_order )
layer->layerid = layernum++;
/// Back copper has a special id number, so assign that to the last copper layer
/// in the stackup
layer_order.back()->layerid = B_Cu;
for( size_t layeri = 0; layeri < layer_order.size(); ++layeri )
{
FABMASTER_LAYER* layer = layer_order[layeri];
if( layeri == 0 )
layer->layerid = F_Cu;
else if( layeri == layer_order.size() - 1 )
layer->layerid = B_Cu;
else
layer->layerid = layeri * 2 + 2;
}
for( auto& new_pair : extra_layers )
{