From e9b8cac3201d7325af1fa0d3ffd192f722586efe Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Mon, 24 Aug 2020 19:32:38 -0400 Subject: [PATCH] Erase net colors when they are reset by the user Fixes https://gitlab.com/kicad/code/kicad/-/issues/5342 --- pcbnew/widgets/appearance_controls.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcbnew/widgets/appearance_controls.cpp b/pcbnew/widgets/appearance_controls.cpp index d4fbda90e8..62c20b5f1c 100644 --- a/pcbnew/widgets/appearance_controls.cpp +++ b/pcbnew/widgets/appearance_controls.cpp @@ -264,7 +264,10 @@ void NET_GRID_TABLE::updateNetColor( const NET_GRID_ENTRY& aNet ) std::map& netColors = rs->GetNetColorMap(); - netColors[aNet.code] = aNet.color; + if( aNet.color != COLOR4D::UNSPECIFIED ) + netColors[aNet.code] = aNet.color; + else + netColors.erase( aNet.code ); m_frame->GetCanvas()->GetView()->UpdateAllLayersColor(); m_frame->GetCanvas()->RedrawRatsnest();