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

(cherry picked from commit 5ba2896968)
This commit is contained in:
Jeff Young 2024-06-15 17:51:56 +01:00
parent 4ee2a007eb
commit df3924421d
1 changed files with 9 additions and 2 deletions

View File

@ -772,8 +772,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() )
{