TransformRingToPolygon(): fix incorrect approximation of the hole.

This commit is contained in:
jean-pierre charras 2021-07-06 13:55:28 +02:00
parent 43cce8b0b5
commit ec64e8ad5b
1 changed files with 4 additions and 1 deletions

View File

@ -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 );