Fix broken PDF plotter for arcs.

This commit is contained in:
jean-pierre charras 2022-01-26 20:15:17 +01:00
parent 8a17fb8d19
commit 810a49ef1b
1 changed files with 6 additions and 6 deletions

View File

@ -288,21 +288,21 @@ void PDF_PLOTTER::Arc( const VECTOR2I& aCenter, const EDA_ANGLE& aStartAngle,
SetCurrentLineWidth( aWidth );
// Usual trig arc plotting routine...
start.x = aCenter.x + KiROUND( aRadius * -startAngle.Cos() );
start.y = aCenter.y + KiROUND( aRadius * -startAngle.Sin() );
start.x = aCenter.x + KiROUND( aRadius * (-startAngle).Cos() );
start.y = aCenter.y + KiROUND( aRadius * (-startAngle).Sin() );
VECTOR2D pos_dev = userToDeviceCoordinates( start );
fprintf( workFile, "%g %g m ", pos_dev.x, pos_dev.y );
for( EDA_ANGLE ii = startAngle + delta; ii < endAngle; ii += delta )
{
end.x = aCenter.x + KiROUND( aRadius * -ii.Cos() );
end.y = aCenter.y + KiROUND( aRadius * -ii.Sin() );
end.x = aCenter.x + KiROUND( aRadius * (-ii).Cos() );
end.y = aCenter.y + KiROUND( aRadius * (-ii).Sin() );
pos_dev = userToDeviceCoordinates( end );
fprintf( workFile, "%g %g l ", pos_dev.x, pos_dev.y );
}
end.x = aCenter.x + KiROUND( aRadius * -endAngle.Cos() );
end.y = aCenter.y + KiROUND( aRadius * -endAngle.Sin() );
end.x = aCenter.x + KiROUND( aRadius * (-endAngle).Cos() );
end.y = aCenter.y + KiROUND( aRadius * (-endAngle).Sin() );
pos_dev = userToDeviceCoordinates( end );
fprintf( workFile, "%g %g l ", pos_dev.x, pos_dev.y );