From a746d31038ae2c8e3ce22e6f309767c0699295e7 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 27 Nov 2021 15:21:47 -0500 Subject: [PATCH] PNS: Fix loop removal outside shove mode Fixes https://gitlab.com/kicad/code/kicad/-/issues/9680 --- pcbnew/router/pns_line_placer.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pcbnew/router/pns_line_placer.cpp b/pcbnew/router/pns_line_placer.cpp index daaf75e53e..05b4060fa3 100644 --- a/pcbnew/router/pns_line_placer.cpp +++ b/pcbnew/router/pns_line_placer.cpp @@ -1222,7 +1222,7 @@ bool LINE_PLACER::Move( const VECTOR2I& aP, ITEM* aEndItem ) if( reachesEnd && eiDepth >= 0 - && aEndItem && latestNode->Depth() > eiDepth + && aEndItem && latestNode->Depth() >= eiDepth && current.SegmentCount() ) { SplitAdjacentSegments( m_lastNode, aEndItem, current.CPoint( -1 ) ); @@ -1563,8 +1563,18 @@ void LINE_PLACER::simplifyNewLine( NODE* aNode, LINKED_ITEM* aLatest ) for( ITEM* neighbor : aJoint->Links() ) { - if( neighbor == aItem || !neighbor->LayersOverlap( aItem ) ) + if( neighbor == aItem + || !neighbor->OfKind( ITEM::SEGMENT_T | ITEM::ARC_T ) + || !neighbor->LayersOverlap( aItem ) ) + { + continue; + } + + if( static_cast( neighbor )->Width() + != static_cast( aItem )->Width() ) + { continue; + } const SEG& testSeg = static_cast( neighbor )->Seg();