Improve moving, rendering and plotting of very small angle arcs.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17110
This commit is contained in:
Alex Shvartzkop
2024-04-03 00:40:18 +03:00
parent 8260c174e9
commit b905b4eac8
5 changed files with 42 additions and 12 deletions
+7
View File
@@ -565,6 +565,13 @@ void HPGL_PLOTTER::Arc( const VECTOR2D& aCenter, const EDA_ANGLE& aStartAngle,
if( aRadius <= 0 )
return;
// Avoid integer overflow when calculating the center point
if( std::abs( aAngle.AsDegrees() ) < 5 )
{
polyArc( aCenter, aStartAngle, aAngle, aRadius, aFill, aWidth );
return;
}
double const radius_device = userToDeviceSize( aRadius );
double const circumf_device = 2.0 * M_PI * radius_device;
double const target_chord_length = m_arcTargetChordLength;