From c85590a470b9c1084ae75984a2ec741813bee589 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 27 Dec 2022 14:34:08 +0000 Subject: [PATCH] Correct is-inside logic. Fixes https://gitlab.com/kicad/code/kicad/issues/13259 --- pcbnew/convert_shape_list_to_polygon.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; + } } }