Fix clearing netclass color override

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5327
This commit is contained in:
Jon Evans 2020-08-23 12:05:03 -04:00
parent f5a6492f85
commit 9a0f956b92
1 changed files with 5 additions and 4 deletions

View File

@ -1862,11 +1862,12 @@ void APPEARANCE_CONTROLS::onNetclassColorChanged( wxCommandEvent& aEvent )
COLOR_SWATCH* swatch = static_cast<COLOR_SWATCH*>( aEvent.GetEventObject() );
wxString className = netclassNameFromEvent( aEvent );
COLOR4D newColor = swatch->GetSwatchColor();
netclassColors[className] = swatch->GetSwatchColor();
if( swatch->GetSwatchColor() == COLOR4D::UNSPECIFIED )
swatch->Hide();
if( newColor == COLOR4D::UNSPECIFIED )
netclassColors.erase( className );
else
netclassColors[className] = swatch->GetSwatchColor();
m_frame->GetCanvas()->GetView()->UpdateAllLayersColor();
m_frame->GetCanvas()->RedrawRatsnest();