Ensure arcs are handled in topology

Use the connection-independent `Anchor()` function to get connection
points for either arcs or segments in topology.  This allows the
ratsnest to be correctly drawn between nets with arcs

Fixes https://gitlab.com/kicad/code/kicad/issues/12205
This commit is contained in:
Seth Hillbrand 2022-08-12 20:05:45 -07:00
parent d142cf239e
commit 1ce8fc1614
1 changed files with 3 additions and 4 deletions

View File

@ -74,11 +74,10 @@ const TOPOLOGY::JOINT_SET TOPOLOGY::ConnectedJoints( JOINT* aStart )
for( ITEM* item : current->LinkList() ) for( ITEM* item : current->LinkList() )
{ {
if( item->OfKind( ITEM::SEGMENT_T ) ) if( item->OfKind( ITEM::SEGMENT_T | ITEM::ARC_T ) )
{ {
SEGMENT* seg = static_cast<SEGMENT*>( item ); JOINT* a = m_world->FindJoint( item->Anchor( 0 ), item );;
JOINT* a = m_world->FindJoint( seg->Seg().A, seg ); JOINT* b = m_world->FindJoint( item->Anchor( 1 ), item );;
JOINT* b = m_world->FindJoint( seg->Seg().B, seg );
JOINT* next = ( *a == *current ) ? b : a; JOINT* next = ( *a == *current ) ? b : a;
if( processed.find( next ) == processed.end() ) if( processed.find( next ) == processed.end() )