Fix logic error when filling zones.

Fixes https://gitlab.com/kicad/code/kicad/issues/12542
This commit is contained in:
Jeff Young 2022-09-29 17:45:59 +01:00
parent d67437a2aa
commit b6efb88ee9
1 changed files with 12 additions and 2 deletions

View File

@ -714,13 +714,23 @@ static void enclosedByAreaFunc( LIBEVAL::CONTEXT* aCtx, void* self )
return i->second;
SHAPE_POLY_SET itemShape;
bool enclosedByArea;
item->TransformShapeWithClearanceToPolygon( itemShape, layer, 0,
maxError, ERROR_OUTSIDE );
itemShape.BooleanSubtract( *aArea->Outline(), SHAPE_POLY_SET::PM_FAST );
if( itemShape.IsEmpty() )
{
// If it's already empty then our test will have no meaning.
enclosedByArea = false;
}
else
{
itemShape.BooleanSubtract( *aArea->Outline(),
SHAPE_POLY_SET::PM_FAST );
bool enclosedByArea = itemShape.IsEmpty();
enclosedByArea = itemShape.IsEmpty();
}
board->m_EnclosedByAreaCache[ key ] = enclosedByArea;