Avoid to change the alpha channel color value initially set in GAL mode when modifying a color in legacy mode.

This commit is contained in:
jean-pierre charras 2017-08-04 09:45:10 +02:00
parent 3570154ef0
commit 33e05ae557
2 changed files with 14 additions and 4 deletions

View File

@ -541,6 +541,15 @@ void PCB_LAYER_WIDGET::ReFill()
void PCB_LAYER_WIDGET::OnLayerColorChange( int aLayer, COLOR4D aColor ) void PCB_LAYER_WIDGET::OnLayerColorChange( int aLayer, COLOR4D aColor )
{ {
// Avoid setting the alpha channel, when we are in legacy mode,
// because in legacy mode the alpha channel is not used, but changing it
// destroys the GAL color setup
if( !myframe->IsGalCanvasActive() )
{
COLOR4D oldColor = myframe->GetBoard()->GetLayerColor( ToLAYER_ID( aLayer ) );
aColor.a = oldColor.a;
}
myframe->GetBoard()->SetLayerColor( ToLAYER_ID( aLayer ), aColor ); myframe->GetBoard()->SetLayerColor( ToLAYER_ID( aLayer ), aColor );
if( myframe->IsGalCanvasActive() ) if( myframe->IsGalCanvasActive() )

View File

@ -365,13 +365,14 @@ PARAM_CFG_ARRAY& PCB_EDIT_FRAME::GetConfigurationSettings()
// layer colors: // layer colors:
wxASSERT( DIM( cds.m_LayersColors ) >= PCB_LAYER_ID_COUNT ); wxASSERT( DIM( cds.m_LayersColors ) >= PCB_LAYER_ID_COUNT );
for( int i = 0; i<PCB_LAYER_ID_COUNT; ++i ) for( int i = 0; i<PCB_LAYER_ID_COUNT; ++i )
{ {
wxString vn = wxString::Format( wxString vn = wxString::Format( "ColorPCBLayer_%s",
wxT( "ColorPCBLayer_%s" ), LSET::Name( PCB_LAYER_ID( i ) ) );
LSET::Name( PCB_LAYER_ID( i ) ) );
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, vn, LOC_COLOR( i ), cds.m_LayersColors[i] ) ); m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, vn, LOC_COLOR( i ),
cds.m_LayersColors[i] ) );
} }
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorTxtFrontEx" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorTxtFrontEx" ),