mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
kicad-cli export gerbers: avoid incorrect behavior with a broken layer list.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20555
This commit is contained in:
parent
d4cc91f17a
commit
91d9863cc3
@ -1052,10 +1052,15 @@ int PCBNEW_JOBS_HANDLER::JobExportGerbers( JOB* aJob )
|
||||
brd->GetProject()->ApplyTextVars( aJob->GetVarOverrides() );
|
||||
brd->SynchronizeProperties();
|
||||
|
||||
bool hasLayerListSpecified = false; // will be true if the user layer list is not empty
|
||||
|
||||
if( aGerberJob->m_argLayers )
|
||||
{
|
||||
if( !aGerberJob->m_argLayers.value().empty() )
|
||||
{
|
||||
aGerberJob->m_plotLayerSequence = convertLayerArg( aGerberJob->m_argLayers.value(), nullptr );
|
||||
hasLayerListSpecified = true;
|
||||
}
|
||||
else
|
||||
aGerberJob->m_plotLayerSequence = LSET::AllLayersMask().SeqStackupForPlotting();
|
||||
}
|
||||
@ -1081,8 +1086,9 @@ int PCBNEW_JOBS_HANDLER::JobExportGerbers( JOB* aJob )
|
||||
}
|
||||
else
|
||||
{
|
||||
// default to the board enabled layers
|
||||
if( aGerberJob->m_plotLayerSequence.empty() )
|
||||
// default to the board enabled layers, but only if the user has not specifed a layer list
|
||||
// ( m_plotLayerSequence can be empty with a broken user layer list)
|
||||
if( aGerberJob->m_plotLayerSequence.empty() && !hasLayerListSpecified )
|
||||
aGerberJob->m_plotLayerSequence = brd->GetEnabledLayers().SeqStackupForPlotting();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user