enclosedByArea test for zone needs to be outline-based.

(Otherwise it's order-specific when filling, which
is pretty unpredictable.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18202
This commit is contained in:
Jeff Young 2024-06-15 17:51:56 +01:00
parent eae85742cc
commit 5ba2896968
1 changed files with 9 additions and 2 deletions

View File

@ -812,8 +812,15 @@ static void enclosedByAreaFunc( LIBEVAL::CONTEXT* aCtx, void* self )
SHAPE_POLY_SET itemShape;
bool enclosedByArea;
item->TransformShapeToPolygon( itemShape, layer, 0, maxError,
ERROR_OUTSIDE );
if( item->Type() == PCB_ZONE_T )
{
itemShape = *static_cast<ZONE*>( item )->Outline();
}
else
{
item->TransformShapeToPolygon( itemShape, layer, 0, maxError,
ERROR_OUTSIDE );
}
if( itemShape.IsEmpty() )
{