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

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17110


(cherry picked from commit b905b4eac8)
This commit is contained in:
Alex Shvartzkop
2024-04-02 21:41:09 +00:00
committed by dsa-t
parent e0381f25f7
commit bac0820864
5 changed files with 42 additions and 12 deletions
+6 -6
View File
@@ -191,8 +191,8 @@ void PLOTTER::polyArc( const VECTOR2D& aCenter, const EDA_ANGLE& aStartAngle,
SetCurrentLineWidth( aWidth );
start.x = aCenter.x + KiROUND( aRadius * startAngle.Cos() );
start.y = aCenter.y + sign * KiROUND( aRadius * startAngle.Sin() );
start.x = KiROUND( aCenter.x + aRadius * startAngle.Cos() );
start.y = KiROUND( aCenter.y + sign * aRadius * startAngle.Sin() );
if( aFill != FILL_T::NO_FILL )
{
@@ -206,13 +206,13 @@ void PLOTTER::polyArc( const VECTOR2D& aCenter, const EDA_ANGLE& aStartAngle,
for( EDA_ANGLE ii = startAngle + delta; ii < endAngle; ii += delta )
{
end.x = aCenter.x + KiROUND( aRadius * ii.Cos() );
end.y = aCenter.y + sign * KiROUND( aRadius * ii.Sin() );
end.x = KiROUND( aCenter.x + aRadius * ii.Cos() );
end.y = KiROUND( aCenter.y + sign * aRadius * ii.Sin() );
LineTo( end );
}
end.x = aCenter.x + KiROUND( aRadius * endAngle.Cos() );
end.y = aCenter.y + sign * KiROUND( aRadius * endAngle.Sin() );
end.x = KiROUND( aCenter.x + aRadius * endAngle.Cos() );
end.y = KiROUND( aCenter.y + sign * aRadius * endAngle.Sin() );
if( aFill != FILL_T::NO_FILL )
{