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 ) )
{
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_NOCONNECT_CONNECTED );
VECTOR2I pos;
if( pin )
{
ercItem->SetItems( pin, aSubgraph->m_no_connect );
pos = pin->GetTransformedPosition();
}
else
{
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 );
ok = false;