diff --git a/pcbnew/convert_shape_list_to_polygon.cpp b/pcbnew/convert_shape_list_to_polygon.cpp index 5601729b7e..da8a0931d8 100644 --- a/pcbnew/convert_shape_list_to_polygon.cpp +++ b/pcbnew/convert_shape_list_to_polygon.cpp @@ -706,10 +706,15 @@ bool BuildBoardPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, int aE for( int ii = 0; ii < fpHoles.OutlineCount(); ++ii ) { + const VECTOR2I holePt = fpHoles.Outline( ii ).CPoint( 0 ); + for( int jj = 0; jj < aOutlines.OutlineCount(); ++jj ) { - if( aOutlines.Outline( jj ).Intersects( fpHoles.Outline( ii ) ) ) + if( aOutlines.Outline( jj ).PointInside( holePt ) ) + { aOutlines.AddHole( fpHoles.Outline( ii ), jj ); + break; + } } }