Zones must be entirely inside for insideCourtyard.

This is a huge performance win as otherwise we're doing *lots* of
shape collisions with ground planes.

Fixes https://gitlab.com/kicad/code/kicad/issues/7720
This commit is contained in:
Jeff Young 2021-02-26 17:18:31 +00:00
parent 22005299af
commit c7a71b44e5
1 changed files with 11 additions and 2 deletions

View File

@ -177,8 +177,17 @@ static void insideCourtyard( LIBEVAL::CONTEXT* aCtx, void* self )
else
footprintCourtyard = footprint->GetPolyCourtyardFront();
if( item->Type() == PCB_ZONE_T || item->Type() == PCB_FP_ZONE_T )
{
// A zone must be entirely inside the courtyard to be considered
if( !footprint->GetBoundingBox().Contains( itemBBox ) )
return false;
}
else
{
if( !footprint->GetBoundingBox().Intersects( itemBBox ) )
return false;
}
if( !shape )
shape = item->GetEffectiveShape( context->GetLayer() );