pcbnew: Prevent no-connects from driving clusters

The no-connect net (0) should never drive the net of a cluster.
Otherwise, tracks connecting between unconnected pads and connected pads
can acquire net 0 incorrectly.
This commit is contained in:
Seth Hillbrand 2019-05-21 19:29:29 -07:00
parent 68451a2a9c
commit 6f7475dcd3
2 changed files with 6 additions and 3 deletions

View File

@ -330,7 +330,10 @@ void CN_CLUSTER::Add( CN_ITEM* item )
{
m_items.push_back( item );
if( m_originNet < 0 )
if( item->Net() <= 0 )
return;
if( m_originNet <= 0 )
{
m_originNet = item->Net();
}

View File

@ -482,7 +482,7 @@ public:
bool HasValidNet() const
{
return m_originNet >= 0;
return m_originNet > 0;
}
int OriginNet() const
@ -503,7 +503,7 @@ public:
bool HasNet() const
{
return m_originNet >= 0;
return m_originNet > 0;
}
bool IsOrphaned() const