Browse Source

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

pull/7/merge
jean-pierre charras 8 years ago
parent
commit
33e05ae557
  1. 9
      pcbnew/class_pcb_layer_widget.cpp
  2. 9
      pcbnew/pcbnew_config.cpp

9
pcbnew/class_pcb_layer_widget.cpp

@ -541,6 +541,15 @@ void PCB_LAYER_WIDGET::ReFill()
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 );
if( myframe->IsGalCanvasActive() )

9
pcbnew/pcbnew_config.cpp

@ -365,13 +365,14 @@ PARAM_CFG_ARRAY& PCB_EDIT_FRAME::GetConfigurationSettings()
// layer colors:
wxASSERT( DIM( cds.m_LayersColors ) >= PCB_LAYER_ID_COUNT );
for( int i = 0; i<PCB_LAYER_ID_COUNT; ++i )
{
wxString vn = wxString::Format(
wxT( "ColorPCBLayer_%s" ),
LSET::Name( PCB_LAYER_ID( i ) ) );
wxString vn = wxString::Format( "ColorPCBLayer_%s",
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" ),

Loading…
Cancel
Save