Properly exclude colorless GAL layers

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4793
This commit is contained in:
Jon Evans 2020-07-03 23:23:58 -04:00
parent a02a4ff179
commit 2f4a14a57b
1 changed files with 6 additions and 12 deletions

View File

@ -60,13 +60,11 @@ PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS( PCB_EDIT_FRAME* aFrame
mgr.ReloadColorSettings(); mgr.ReloadColorSettings();
createThemeList( app_settings->m_ColorTheme ); createThemeList( app_settings->m_ColorTheme );
for( int id = F_Cu; id < PCB_LAYER_ID_COUNT; id++ ) for( int id = GAL_LAYER_ID_START; id < GAL_LAYER_ID_BITMASK_END; id++ )
m_validLayers.push_back( id );
for( int id = GAL_LAYER_ID_START; id < GAL_LAYER_ID_END; id++ )
{ {
if( id == LAYER_VIAS || id == LAYER_GRID_AXES || id == LAYER_PADS_PLATEDHOLES if( id == LAYER_VIAS || id == LAYER_GRID_AXES || id == LAYER_PADS_PLATEDHOLES
|| id == LAYER_VIAS_HOLES ) || id == LAYER_VIAS_HOLES || id == LAYER_DRAW_BITMAPS
|| id == LAYER_GP_OVERLAY )
{ {
continue; continue;
} }
@ -74,6 +72,8 @@ PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS( PCB_EDIT_FRAME* aFrame
m_validLayers.push_back( id ); m_validLayers.push_back( id );
} }
// NOTE: Main board layers are added by createSwatches()
m_backgroundLayer = LAYER_PCB_BACKGROUND; m_backgroundLayer = LAYER_PCB_BACKGROUND;
m_colorsMainSizer->Insert( 0, 10, 0, 0, wxEXPAND, 5 ); m_colorsMainSizer->Insert( 0, 10, 0, 0, wxEXPAND, 5 );
@ -116,13 +116,7 @@ bool PANEL_PCBNEW_COLOR_SETTINGS::TransferDataToWindow()
void PANEL_PCBNEW_COLOR_SETTINGS::createSwatches() void PANEL_PCBNEW_COLOR_SETTINGS::createSwatches()
{ {
std::vector<int> layers; std::vector<int> layers( m_validLayers );
for( GAL_LAYER_ID i = GAL_LAYER_ID_START; i < GAL_LAYER_ID_END; ++i )
{
if( m_currentSettings->GetColor( i ) != COLOR4D::UNSPECIFIED )
layers.push_back( i );
}
std::sort( layers.begin(), layers.end(), std::sort( layers.begin(), layers.end(),
[]( int a, int b ) []( int a, int b )