diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp index e4045d183f..907c5aee22 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcbnew_control.cpp @@ -488,17 +488,19 @@ int PCBNEW_CONTROL::LayerToggle( const TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::LayerAlphaInc( const TOOL_EVENT& aEvent ) { - auto painter = static_cast( getView()->GetPainter() ); - auto settings = painter->GetSettings(); + auto& settings = m_frame->Settings().Colors(); LAYER_NUM currentLayer = m_frame->GetActiveLayer(); - KIGFX::COLOR4D currentColor = settings->GetLayerColor( currentLayer ); + KIGFX::COLOR4D currentColor = settings.GetLayerColor( currentLayer ); if( currentColor.a <= ALPHA_MAX - ALPHA_STEP ) { currentColor.a += ALPHA_STEP; - settings->SetLayerColor( currentLayer, currentColor ); - m_frame->GetGalCanvas()->GetView()->UpdateLayerColor( currentLayer ); + settings.SetLayerColor( currentLayer, currentColor ); + + KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView(); + view->GetPainter()->GetSettings()->ImportLegacyColors( &settings ); + view->UpdateLayerColor( currentLayer ); wxUpdateUIEvent dummy; static_cast( m_frame )->OnUpdateLayerAlpha( dummy ); @@ -512,17 +514,19 @@ int PCBNEW_CONTROL::LayerAlphaInc( const TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::LayerAlphaDec( const TOOL_EVENT& aEvent ) { - auto painter = static_cast( getView()->GetPainter() ); - auto settings = painter->GetSettings(); + auto& settings = m_frame->Settings().Colors(); LAYER_NUM currentLayer = m_frame->GetActiveLayer(); - KIGFX::COLOR4D currentColor = settings->GetLayerColor( currentLayer ); + KIGFX::COLOR4D currentColor = settings.GetLayerColor( currentLayer ); if( currentColor.a >= ALPHA_MIN + ALPHA_STEP ) { currentColor.a -= ALPHA_STEP; - settings->SetLayerColor( currentLayer, currentColor ); - m_frame->GetGalCanvas()->GetView()->UpdateLayerColor( currentLayer ); + settings.SetLayerColor( currentLayer, currentColor ); + + KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView(); + view->GetPainter()->GetSettings()->ImportLegacyColors( &settings ); + view->UpdateLayerColor( currentLayer ); wxUpdateUIEvent dummy; static_cast( m_frame )->OnUpdateLayerAlpha( dummy );