diff --git a/pcbnew/router/pns_tool_base.cpp b/pcbnew/router/pns_tool_base.cpp index 169a6ffcf4..999f5fcfad 100644 --- a/pcbnew/router/pns_tool_base.cpp +++ b/pcbnew/router/pns_tool_base.cpp @@ -71,6 +71,7 @@ TOOL_BASE::TOOL_BASE( const std::string& aToolName ) : m_startItem = nullptr; m_startLayer = 0; + m_startHighlight = false; m_endItem = nullptr; m_gridHelper = nullptr; @@ -210,9 +211,20 @@ void TOOL_BASE::highlightNet( bool aEnabled, int aNetcode ) RENDER_SETTINGS* rs = getView()->GetPainter()->GetSettings(); if( aNetcode >= 0 && aEnabled ) + { + // If the user has previously set the current net to be highlighted, + // we assume they want to keep it highlighted after routing + m_startHighlight = ( rs->IsHighlightEnabled() && rs->GetHighlightNetCode() == aNetcode ); + rs->SetHighlight( true, aNetcode ); + } else - rs->SetHighlight( false ); + { + if( !m_startHighlight ) + rs->SetHighlight( false ); + + m_startHighlight = false; + } getView()->UpdateAllLayersColor(); } diff --git a/pcbnew/router/pns_tool_base.h b/pcbnew/router/pns_tool_base.h index e3bc22b4c1..5ee6d6ce1a 100644 --- a/pcbnew/router/pns_tool_base.h +++ b/pcbnew/router/pns_tool_base.h @@ -68,6 +68,7 @@ protected: ITEM* m_startItem; int m_startLayer; VECTOR2I m_startSnapPoint; + bool m_startHighlight; ///< Keeps track of whether the net was highlighted before routing ITEM* m_endItem; VECTOR2I m_endSnapPoint;