Don't try to fetch layer of multi-layer objects.

This commit is contained in:
Jeff Young 2022-02-18 12:52:25 +00:00
parent 81bed9ab96
commit ce0233577b
2 changed files with 3 additions and 3 deletions

View File

@ -181,8 +181,8 @@ bool BOARD_ITEM::ptr_cmp::operator() ( const BOARD_ITEM* a, const BOARD_ITEM* b
if( a->Type() != b->Type() )
return a->Type() < b->Type();
if( a->GetLayer() != b->GetLayer() )
return a->GetLayer() < b->GetLayer();
if( a->GetLayerSet() != b->GetLayerSet() )
return a->GetLayerSet().Seq() < b->GetLayerSet().Seq();
if( a->m_Uuid != b->m_Uuid ) // UUIDs *should* always be unique (for valid boards anyway)
return a->m_Uuid < b->m_Uuid;

View File

@ -255,7 +255,7 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run()
m_largestClearance );
}
if( testSilk && ( item->GetLayer() == F_SilkS || item->GetLayer() == B_SilkS ) )
if( testSilk && ( item->IsOnLayer( F_SilkS ) || item->IsOnLayer( B_SilkS ) ) )
{
if( edgesTree.QueryColliding( item, UNDEFINED_LAYER, testLayer, nullptr,
[&]( BOARD_ITEM* edge ) -> bool