diff --git a/pcbnew/pcbexpr_functions.cpp b/pcbnew/pcbexpr_functions.cpp index 4b638fa0c9..de3792f7f0 100644 --- a/pcbnew/pcbexpr_functions.cpp +++ b/pcbnew/pcbexpr_functions.cpp @@ -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( item )->Outline(); + } + else + { + item->TransformShapeToPolygon( itemShape, layer, 0, maxError, + ERROR_OUTSIDE ); + } if( itemShape.IsEmpty() ) {