Cherry-pick the short-arc-is-really-a-segment fix from master.

Fixes https://gitlab.com/kicad/code/kicad/issues/11119
This commit is contained in:
Jeff Young 2022-03-13 13:40:12 +00:00
parent 5c63df28e4
commit 0070a4686e
1 changed files with 11 additions and 0 deletions

View File

@ -536,6 +536,17 @@ void TransformArcToPolygon( SHAPE_POLY_SET& aCornerBuffer, const wxPoint& aStart
const wxPoint& aMid, const wxPoint& aEnd, int aWidth,
int aError, ERROR_LOC aErrorLoc )
{
SEG startToEnd( aStart, aEnd );
int distanceToMid = startToEnd.Distance( aMid );
if( distanceToMid <= 1 )
{
// Not an arc but essentially a straight line with a small error
TransformOvalToPolygon( aCornerBuffer, aStart, aEnd, aWidth + distanceToMid, aError,
aErrorLoc );
return;
}
SHAPE_ARC arc( aStart, aMid, aEnd, aWidth );
// Currentlye have currently 2 algos:
// the first approximates the thick arc from its outlines