From faba2b06c2194bef224c5a31f1310b330a11f73f Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 14 Oct 2021 09:19:39 -0700 Subject: [PATCH] Lock track width after placing segment We don't want to allow the full track width to change after placing a segment when we are in follow-segment mode. This would require either ripping up and re-solving the existing track or allowing potential DRC errors. Fixes https://gitlab.com/kicad/code/kicad/issues/9395 --- pcbnew/router/pns_line_placer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pcbnew/router/pns_line_placer.cpp b/pcbnew/router/pns_line_placer.cpp index 6f1015bade..7876d4fa9b 100644 --- a/pcbnew/router/pns_line_placer.cpp +++ b/pcbnew/router/pns_line_placer.cpp @@ -1612,10 +1612,14 @@ void LINE_PLACER::UpdateSizes( const SIZES_SETTINGS& aSizes ) if( !m_idle ) { // If the track width continues from an existing track, we don't want to change the width. - if( m_sizes.TrackWidthIsExplicit() || m_startItem->Kind() != ITEM::SEGMENT_T ) + // Disallow changing width after the first segment has been fixed because we don't want to + // go back and rip up tracks or allow DRC errors + if( m_sizes.TrackWidthIsExplicit() || ( !HasPlacedAnything() + && ( !m_startItem || m_startItem->Kind() != ITEM::SEGMENT_T ) ) ) { m_head.SetWidth( m_sizes.TrackWidth() ); m_tail.SetWidth( m_sizes.TrackWidth() ); + m_currentTrace.SetWidth( m_sizes.TrackWidth() ); } if( m_head.EndsWithVia() )