PNS: Fix loop removal outside shove mode

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9680
This commit is contained in:
Jon Evans 2021-11-27 15:21:47 -05:00
parent 8a0f8c329f
commit a746d31038
1 changed files with 12 additions and 2 deletions

View File

@ -1222,7 +1222,7 @@ bool LINE_PLACER::Move( const VECTOR2I& aP, ITEM* aEndItem )
if( reachesEnd if( reachesEnd
&& eiDepth >= 0 && eiDepth >= 0
&& aEndItem && latestNode->Depth() > eiDepth && aEndItem && latestNode->Depth() >= eiDepth
&& current.SegmentCount() ) && current.SegmentCount() )
{ {
SplitAdjacentSegments( m_lastNode, aEndItem, current.CPoint( -1 ) ); 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() ) 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; continue;
}
if( static_cast<SEGMENT*>( neighbor )->Width()
!= static_cast<SEGMENT*>( aItem )->Width() )
{
continue;
}
const SEG& testSeg = static_cast<SEGMENT*>( neighbor )->Seg(); const SEG& testSeg = static_cast<SEGMENT*>( neighbor )->Seg();