From ec64e8ad5bbb4e7d92d6f720ed728f2406514897 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 6 Jul 2021 13:55:28 +0200 Subject: [PATCH] TransformRingToPolygon(): fix incorrect approximation of the hole. --- libs/kimath/src/convert_basic_shapes_to_polygon.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/kimath/src/convert_basic_shapes_to_polygon.cpp b/libs/kimath/src/convert_basic_shapes_to_polygon.cpp index 426cbc661b..f80ee661eb 100644 --- a/libs/kimath/src/convert_basic_shapes_to_polygon.cpp +++ b/libs/kimath/src/convert_basic_shapes_to_polygon.cpp @@ -576,7 +576,10 @@ void TransformRingToPolygon( SHAPE_POLY_SET& aCornerBuffer, wxPoint aCentre, int // Build the hole: buffer.NewHole(); - TransformCircleToPolygon( buffer.Hole( 0, 0 ), aCentre, inner_radius, aError, aErrorLoc ); + // The circle is the hole, so the approximation error location is the opposite of aErrorLoc + ERROR_LOC inner_err_loc = aErrorLoc == ERROR_OUTSIDE ? ERROR_INSIDE : ERROR_OUTSIDE; + TransformCircleToPolygon( buffer.Hole( 0, 0 ), aCentre, inner_radius, + aError, inner_err_loc ); buffer.Fracture( SHAPE_POLY_SET::PM_FAST ); aCornerBuffer.Append( buffer );