Check for layer when DRC on vias and non-zone items

We were already checking for zone-zone overlap but missing checks when
running against (possibly) buried vias as well as the general check

Fixes https://gitlab.com/kicad/code/kicad/issues/9366
This commit is contained in:
Seth Hillbrand 2021-10-11 10:18:28 -07:00
parent 8dbe60b0d5
commit 58f553a9ca
1 changed files with 6 additions and 1 deletions

View File

@ -474,6 +474,8 @@ bool calcIsInsideArea( BOARD_ITEM* aItem, const EDA_RECT& aItemBBox, PCB_EXPR_CO
PCB_VIA* via = static_cast<PCB_VIA*>( aItem ); PCB_VIA* via = static_cast<PCB_VIA*>( aItem );
const SHAPE_CIRCLE holeShape( via->GetPosition(), via->GetDrillValue() ); const SHAPE_CIRCLE holeShape( via->GetPosition(), via->GetDrillValue() );
/// Avoid buried vias that don't overlap the zone's layers
if( ( via->GetLayerSet() & aArea->GetLayerSet() ).any() )
return areaOutline.Collide( &holeShape ); return areaOutline.Collide( &holeShape );
} }
@ -555,6 +557,9 @@ bool calcIsInsideArea( BOARD_ITEM* aItem, const EDA_RECT& aItemBBox, PCB_EXPR_CO
} }
else else
{ {
if( !( aArea->GetLayerSet().Contains( aCtx->GetLayer() ) ) )
return false;
if( !shape ) if( !shape )
shape = aItem->GetEffectiveShape( aCtx->GetLayer() ); shape = aItem->GetEffectiveShape( aCtx->GetLayer() );