Margin layer missing from some edge clearance tests.

Fixes bug reported on KiCad Forums.
This commit is contained in:
Jeff Young 2021-04-21 21:57:56 +01:00
parent 6fdf567b21
commit e5d029af6b
1 changed files with 23 additions and 20 deletions

View File

@ -233,28 +233,31 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run()
const std::shared_ptr<SHAPE>& itemShape = item->GetEffectiveShape(); const std::shared_ptr<SHAPE>& itemShape = item->GetEffectiveShape();
if( testCopper && item->IsOnCopperLayer() ) for( PCB_LAYER_ID testLayer : { Edge_Cuts, Margin } )
{ {
edgesTree.QueryColliding( item, UNDEFINED_LAYER, Edge_Cuts, nullptr, if( testCopper && item->IsOnCopperLayer() )
[&]( BOARD_ITEM* edge ) -> bool {
{ edgesTree.QueryColliding( item, UNDEFINED_LAYER, testLayer, nullptr,
return testAgainstEdge( item, itemShape.get(), edge, [&]( BOARD_ITEM* edge ) -> bool
EDGE_CLEARANCE_CONSTRAINT, {
DRCE_COPPER_EDGE_CLEARANCE ); return testAgainstEdge( item, itemShape.get(), edge,
}, EDGE_CLEARANCE_CONSTRAINT,
m_largestClearance ); DRCE_COPPER_EDGE_CLEARANCE );
} },
m_largestClearance );
}
if( testSilk && ( item->GetLayer() == F_SilkS || item->GetLayer() == B_SilkS ) ) if( testSilk && ( item->GetLayer() == F_SilkS || item->GetLayer() == B_SilkS ) )
{ {
edgesTree.QueryColliding( item, UNDEFINED_LAYER, Edge_Cuts, nullptr, edgesTree.QueryColliding( item, UNDEFINED_LAYER, testLayer, nullptr,
[&]( BOARD_ITEM* edge ) -> bool [&]( BOARD_ITEM* edge ) -> bool
{ {
return testAgainstEdge( item, itemShape.get(), edge, return testAgainstEdge( item, itemShape.get(), edge,
SILK_CLEARANCE_CONSTRAINT, SILK_CLEARANCE_CONSTRAINT,
DRCE_SILK_MASK_CLEARANCE ); DRCE_SILK_MASK_CLEARANCE );
}, },
m_largestClearance ); m_largestClearance );
}
} }
} }