mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-13 17:53:11 +02:00
Remove double-layer-processing.
(The caller already handles cycling through the layers.)
This commit is contained in:
parent
1e0a08034f
commit
7fc9fc5f58
@ -462,7 +462,7 @@ static void intersectsBackCourtyardFunc( LIBEVAL::CONTEXT* aCtx, void* self )
|
||||
}
|
||||
|
||||
|
||||
bool collidesWithArea( BOARD_ITEM* aItem, PCBEXPR_CONTEXT* aCtx, ZONE* aArea )
|
||||
bool collidesWithArea( BOARD_ITEM* aItem, PCB_LAYER_ID aLayer, PCBEXPR_CONTEXT* aCtx, ZONE* aArea )
|
||||
{
|
||||
BOARD* board = aArea->GetBoard();
|
||||
BOX2I areaBBox = aArea->GetBoundingBox();
|
||||
@ -552,40 +552,18 @@ bool collidesWithArea( BOARD_ITEM* aItem, PCBEXPR_CONTEXT* aCtx, ZONE* aArea )
|
||||
|
||||
if( zoneRTree )
|
||||
{
|
||||
for( PCB_LAYER_ID layer : aArea->GetLayerSet().Seq() )
|
||||
{
|
||||
if( aCtx->GetLayer() == layer || aCtx->GetLayer() == UNDEFINED_LAYER )
|
||||
{
|
||||
if( zoneRTree->QueryColliding( areaBBox, &areaOutline, layer ) )
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if( zoneRTree->QueryColliding( areaBBox, &areaOutline, aLayer ) )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
else if( aItem->Type() == PCB_PAD_T )
|
||||
{
|
||||
PAD* pad = static_cast<PAD*>( aItem );
|
||||
bool collision = false;
|
||||
|
||||
pad->Padstack().ForEachUniqueLayer(
|
||||
[&]( PCB_LAYER_ID layer )
|
||||
{
|
||||
if( !collision && aArea->IsOnLayer( layer ) )
|
||||
collision = areaOutline.Collide( pad->GetEffectiveShape( layer ).get() );
|
||||
} );
|
||||
|
||||
return collision;
|
||||
}
|
||||
else
|
||||
{
|
||||
PCB_LAYER_ID layer = aCtx->GetLayer();
|
||||
|
||||
if( layer != UNDEFINED_LAYER && !( aArea->GetLayerSet().Contains( layer ) ) )
|
||||
if( !aArea->GetLayerSet().Contains( aLayer ) )
|
||||
return false;
|
||||
|
||||
return areaOutline.Collide( aItem->GetEffectiveShape( layer ).get() );
|
||||
return areaOutline.Collide( aItem->GetEffectiveShape( aLayer ).get() );
|
||||
}
|
||||
}
|
||||
|
||||
@ -761,7 +739,7 @@ static void intersectsAreaFunc( LIBEVAL::CONTEXT* aCtx, void* self )
|
||||
return true;
|
||||
}
|
||||
|
||||
bool collides = collidesWithArea( item, context, aArea );
|
||||
bool collides = collidesWithArea( item, layer, context, aArea );
|
||||
|
||||
if( ( item->GetFlags() & ROUTER_TRANSIENT ) == 0 )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user