Treat net 0 items as each being in their own net.

Fixes https://gitlab.com/kicad/code/kicad/issues/6534
This commit is contained in:
Jeff Young 2020-12-02 20:04:21 +00:00
parent d06d35a74d
commit f2ac6fcd44
4 changed files with 8 additions and 6 deletions

View File

@ -36,7 +36,7 @@ bool ITEM::collideSimple( const ITEM* aOther, int aClearance, bool aNeedMTV, VEC
const SHAPE* shapeB = aOther->Shape(); const SHAPE* shapeB = aOther->Shape();
// same nets? no collision! // same nets? no collision!
if( aDifferentNetsOnly && m_net == aOther->m_net && m_net >= 0 && aOther->m_net >= 0 ) if( aDifferentNetsOnly && m_net == aOther->m_net && m_net > 0 && aOther->m_net > 0 )
return false; return false;
// check if we are not on completely different layers first // check if we are not on completely different layers first

View File

@ -315,7 +315,7 @@ void TOOL_BASE::updateEndItem( const TOOL_EVENT& aEvent )
VECTOR2I mousePos = controls()->GetMousePosition(); VECTOR2I mousePos = controls()->GetMousePosition();
if( m_router->Settings().Mode() != RM_MarkObstacles && if( m_router->Settings().Mode() != RM_MarkObstacles &&
( m_router->GetCurrentNets().empty() || m_router->GetCurrentNets().front() < 0 ) ) ( m_router->GetCurrentNets().empty() || m_router->GetCurrentNets().front() <= 0 ) )
{ {
m_endSnapPoint = snapToItem( snapEnabled, nullptr, mousePos ); m_endSnapPoint = snapToItem( snapEnabled, nullptr, mousePos );
controls()->ForceCursorPosition( true, m_endSnapPoint ); controls()->ForceCursorPosition( true, m_endSnapPoint );

View File

@ -116,10 +116,12 @@ bool TOPOLOGY::LeadingRatLine( const LINE* aTrack, SHAPE_LINE_CHAIN& aRatLine )
} }
else else
{ {
int anchor;
TOPOLOGY topo( tmpNode.get() ); TOPOLOGY topo( tmpNode.get() );
ITEM* it = topo.NearestUnconnectedItem( jt, &anchor ); int anchor = 0;
ITEM* it = nullptr;
if( jt->Net() > 0 )
it = topo.NearestUnconnectedItem( jt, &anchor );
if( !it ) if( !it )
return false; return false;

View File

@ -927,7 +927,7 @@ bool ROUTER_TOOL::prepareInteractive()
editFrame->SetActiveLayer( ToLAYER_ID( routingLayer ) ); editFrame->SetActiveLayer( ToLAYER_ID( routingLayer ) );
if( m_startItem && m_startItem->Net() >= 0 ) if( m_startItem && m_startItem->Net() > 0 )
highlightNet( true, m_startItem->Net() ); highlightNet( true, m_startItem->Net() );
controls()->ForceCursorPosition( false ); controls()->ForceCursorPosition( false );