diff --git a/pcbnew/router/pns_diff_pair_placer.cpp b/pcbnew/router/pns_diff_pair_placer.cpp index e7a15de4b8..c9fc2bf91a 100644 --- a/pcbnew/router/pns_diff_pair_placer.cpp +++ b/pcbnew/router/pns_diff_pair_placer.cpp @@ -540,7 +540,14 @@ bool PNS_DIFF_PAIR_PLACER::findDpPrimitivePair( const VECTOR2I& aP, PNS_ITEM* aI double dist = ( *anchor - *refAnchor ).EuclideanNorm(); - if( dist < bestDist ) + bool shapeMatches = true; + + if( item->OfKind( PNS_ITEM::SOLID ) && item->Layers() != aItem->Layers() ) + { + shapeMatches = false; + } + + if( dist < bestDist && shapeMatches ) { found = true; bestDist = dist; diff --git a/pcbnew/router/pns_layerset.h b/pcbnew/router/pns_layerset.h index c319ea3969..9d01dd1ade 100644 --- a/pcbnew/router/pns_layerset.h +++ b/pcbnew/router/pns_layerset.h @@ -111,6 +111,16 @@ public: return PNS_LAYERSET( 0, 256 ); // fixme: use layer IDs header } + bool operator==( const PNS_LAYERSET& aOther ) const + { + return ( m_start == aOther.m_start ) && ( m_end == aOther.m_end ); + } + + bool operator!=( const PNS_LAYERSET& aOther ) const + { + return ( m_start != aOther.m_start ) || ( m_end != aOther.m_end ); + } + private: int m_start; int m_end;