From 7ceb3d11f2ae8018c6190e23db0d5600ad2f7b9f Mon Sep 17 00:00:00 2001 From: Andreas Beutling Date: Sun, 3 Feb 2013 18:53:48 -0600 Subject: [PATCH] fix some errors in common_plotHPGL_functions.cpp --- common/common_plotHPGL_functions.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/common/common_plotHPGL_functions.cpp b/common/common_plotHPGL_functions.cpp index 5bdbd4e8ef..1c8b39742d 100644 --- a/common/common_plotHPGL_functions.cpp +++ b/common/common_plotHPGL_functions.cpp @@ -393,14 +393,16 @@ void HPGL_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int ra DPOINT centre_dev = userToDeviceCoordinates( centre ); if( plotMirror ) - angle = (StAngle - EndAngle) / 10.0; + angle = StAngle - EndAngle; else - angle = (EndAngle - StAngle) / 10.0; + angle = EndAngle - StAngle; + NORMALIZE_ANGLE_180( angle ); + angle /= 10; // Calculate start point, wxPoint cmap; - cmap.x = (int) ( centre.x + ( radius * cos( RAD2DEG( StAngle / 10.0 ) ) ) ); - cmap.y = (int) ( centre.y - ( radius * sin( RAD2DEG( StAngle / 10.0 ) ) ) ); + cmap.x = int( centre.x + ( radius * cos( DEG2RAD( StAngle / 10.0 ) ) ) ); + cmap.y = int( centre.y - ( radius * sin( DEG2RAD( StAngle / 10.0 ) ) ) ); DPOINT cmap_dev = userToDeviceCoordinates( cmap ); fprintf( outputFile, @@ -478,7 +480,7 @@ void HPGL_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre, double rsize = userToDeviceSize( radius ); - fprintf( outputFile, "PA %.0f,%.0fd;CI %.0f;\n", + fprintf( outputFile, "PA %.0f,%.0f;CI %.0f;\n", pos_dev.x, pos_dev.y, rsize ); if( trace_mode == FILLED ) // Plot in filled mode.