7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 15:23:44 +00:00

Fix enclosedByArea for footprints.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19137
This commit is contained in:
Jeff Young 2024-12-03 12:43:33 +00:00
parent fee1d115a6
commit 610d497600

View File

@ -807,8 +807,11 @@ static void enclosedByAreaFunc( LIBEVAL::CONTEXT* aCtx, void* self )
if( !aArea || aArea == item || aArea->GetParent() == item )
return false;
if( !( aArea->GetLayerSet() & item->GetLayerSet() ).any() )
return false;
if( item->Type() != PCB_FOOTPRINT_T )
{
if( !( aArea->GetLayerSet() & item->GetLayerSet() ).any() )
return false;
}
if( !aArea->GetBoundingBox().Intersects( itemBBox ) )
return false;
@ -832,6 +835,18 @@ static void enclosedByAreaFunc( LIBEVAL::CONTEXT* aCtx, void* self )
{
itemShape = *static_cast<ZONE*>( item )->Outline();
}
else if( item->Type() == PCB_FOOTPRINT_T )
{
FOOTPRINT* fp = static_cast<FOOTPRINT*>( item );
for( PCB_LAYER_ID testLayer : aArea->GetLayerSet() )
{
fp->TransformPadsToPolySet( itemShape, testLayer, 0,
maxError, ERROR_OUTSIDE );
fp->TransformFPShapesToPolySet( itemShape, testLayer, 0,
maxError, ERROR_OUTSIDE );
}
}
else
{
item->TransformShapeToPolygon( itemShape, layer, 0, maxError,