PNS: Fix early exit from followTrivialPath

Don't mark a segment as visited until the
start of the next loop.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20379


(cherry picked from commit 52e9cdde992e0a888f9a66575594758dbcd2336a)

Co-authored-by: Jon Evans <jon@craftyjon.com>
This commit is contained in:
Jon Evans 2025-05-26 22:48:13 -04:00
parent 061cb2eba8
commit 04b9fc76d0

View File

@ -233,7 +233,7 @@ bool TOPOLOGY::followTrivialPath( LINE* aLine2, bool aLeft, ITEM_SET& aSet,
{
if( link->OfKind( ITEM::VIA_T ) )
via = link;
else if( visited.insert( link ).second )
else if( !visited.contains( link ) )
next_seg = static_cast<SEGMENT*>( link );
}