Don't force grid color to LAYER_GRID in EDA_DRAW_PANEL_GAL

This commit is contained in:
Jon Evans 2017-09-11 23:00:41 -04:00 committed by jean-pierre charras
parent e15acbb00d
commit b6298a0a41
3 changed files with 9 additions and 3 deletions

View File

@ -183,9 +183,6 @@ void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
m_gal->SetCursorColor( settings->GetLayerColor( LAYER_CURSOR ) );
m_gal->ClearScreen( );
KIGFX::COLOR4D gridColor = settings->GetLayerColor( LAYER_GRID );
m_gal->SetGridColor( gridColor );
if( m_view->IsDirty() )
{
m_view->ClearTargets();

View File

@ -634,6 +634,9 @@ void PCB_LAYER_WIDGET::OnRenderColorChange( int aId, COLOR4D aColor )
if( galCanvas && myframe->IsGalCanvasActive() )
{
if( aId == LAYER_GRID )
galCanvas->GetGAL()->SetGridColor( aColor );
KIGFX::VIEW* view = galCanvas->GetView();
view->GetPainter()->GetSettings()->ImportLegacyColors( &myframe->Settings().Colors() );
view->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); // useful to update rastnest

View File

@ -714,6 +714,12 @@ void PCB_EDIT_FRAME::UseGalCanvas( bool aEnable )
PCB_BASE_EDIT_FRAME::UseGalCanvas( aEnable );
if( aEnable )
{
COLORS_DESIGN_SETTINGS& cds = Settings().Colors();
GetGalCanvas()->GetGAL()->SetGridColor( cds.GetLayerColor( LAYER_GRID ) );
}
enableGALSpecificMenus();
// Force colors to be legacy-compatible in case they were changed in GAL