No-connects might not be connected to a pin

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

(cherry picked from commit 5657ca5a04)
This commit is contained in:
Jon Evans 2022-12-23 20:50:49 -05:00
parent 45e15f2394
commit c0fb041be6
1 changed files with 8 additions and 1 deletions

View File

@ -2725,13 +2725,20 @@ bool CONNECTION_GRAPH::ercCheckNoConnects( const CONNECTION_SUBGRAPH* aSubgraph
if( unique_pins.size() > 1 && settings.IsTestEnabled( ERCE_NOCONNECT_CONNECTED ) ) if( unique_pins.size() > 1 && settings.IsTestEnabled( ERCE_NOCONNECT_CONNECTED ) )
{ {
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_NOCONNECT_CONNECTED ); std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_NOCONNECT_CONNECTED );
VECTOR2I pos;
if( pin ) if( pin )
{
ercItem->SetItems( pin, aSubgraph->m_no_connect ); ercItem->SetItems( pin, aSubgraph->m_no_connect );
pos = pin->GetTransformedPosition();
}
else else
{
ercItem->SetItems( aSubgraph->m_no_connect ); ercItem->SetItems( aSubgraph->m_no_connect );
pos = aSubgraph->m_no_connect->GetPosition();
}
SCH_MARKER* marker = new SCH_MARKER( ercItem, pin->GetTransformedPosition() ); SCH_MARKER* marker = new SCH_MARKER( ercItem, pos );
screen->Append( marker ); screen->Append( marker );
ok = false; ok = false;