Loading common/class_plotter.cpp +2 −4 Original line number Original line Diff line number Diff line Loading @@ -387,7 +387,7 @@ void PLOTTER::segmentAsOval( const wxPoint& start, const wxPoint& end, int width else if( size.x == 0 ) else if( size.x == 0 ) orient = 900; orient = 900; else else orient = -(int) ( RAD2DEG( atan2( (double)size.y, (double)size.x ) ) * 10.0 ); orient = -ArcTangente( size.y, size.x ); size.x = KiROUND( hypot( size.x, size.y ) ) + width; size.x = KiROUND( hypot( size.x, size.y ) ) + width; size.y = width; size.y = width; Loading @@ -407,9 +407,7 @@ void PLOTTER::sketchOval( const wxPoint& pos, const wxSize& aSize, int orient, if( size.x > size.y ) if( size.x > size.y ) { { EXCHG( size.x, size.y ); EXCHG( size.x, size.y ); orient += 900; orient = AddAngles( orient, 900 ); if( orient >= 3600 ) orient -= 3600; } } deltaxy = size.y - size.x; /* distance between centers of the oval */ deltaxy = size.y - size.x; /* distance between centers of the oval */ Loading common/common_plotDXF_functions.cpp +1 −3 Original line number Original line Diff line number Diff line Loading @@ -423,9 +423,7 @@ void DXF_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int ori if( size.x > size.y ) if( size.x > size.y ) { { EXCHG( size.x, size.y ); EXCHG( size.x, size.y ); orient += 900; orient = AddAngles( orient, 900 ); if( orient >= 3600 ) orient -= 3600; } } sketchOval( pos, size, orient, -1 ); sketchOval( pos, size, orient, -1 ); } } Loading common/common_plotGERBER_functions.cpp +4 −4 Original line number Original line Diff line number Diff line Loading @@ -287,12 +287,12 @@ void GERBER_PLOTTER::Arc( const wxPoint& aCenter, int aStAngle, int aEndAngle, { { wxASSERT( outputFile ); wxASSERT( outputFile ); wxPoint start, end; wxPoint start, end; start.x = aCenter.x + KiROUND( aRadius*cos( DEG2RAD( aStAngle/10.0 ) ) ); start.x = aCenter.x + KiROUND( cosdecideg( aRadius, aStAngle ) ); start.y = aCenter.y - KiROUND( aRadius*sin( DEG2RAD( aStAngle/10.0 ) ) ); start.y = aCenter.y - KiROUND( sindecideg( aRadius, aStAngle ) ); SetCurrentLineWidth( aWidth ); SetCurrentLineWidth( aWidth ); MoveTo( start ); MoveTo( start ); end.x = aCenter.x + KiROUND( aRadius*cos( DEG2RAD( aEndAngle/10.0 ) ) ); end.x = aCenter.x + KiROUND( cosdecideg( aRadius, aEndAngle ) ); end.y = aCenter.y - KiROUND( aRadius*sin( DEG2RAD( aEndAngle/10.0 ) ) ); end.y = aCenter.y - KiROUND( sindecideg( aRadius, aEndAngle ) ); DPOINT devEnd = userToDeviceCoordinates( end ); DPOINT devEnd = userToDeviceCoordinates( end ); DPOINT devCenter = userToDeviceCoordinates( aCenter ) DPOINT devCenter = userToDeviceCoordinates( aCenter ) - userToDeviceCoordinates( start ); - userToDeviceCoordinates( start ); Loading common/common_plotHPGL_functions.cpp +4 −6 Original line number Original line Diff line number Diff line Loading @@ -401,8 +401,8 @@ void HPGL_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int ra // Calculate start point, // Calculate start point, wxPoint cmap; wxPoint cmap; cmap.x = int( centre.x + ( radius * cos( DEG2RAD( StAngle / 10.0 ) ) ) ); cmap.x = centre.x + KiROUND( cosdecideg( radius, StAngle ) ); cmap.y = int( centre.y - ( radius * sin( DEG2RAD( StAngle / 10.0 ) ) ) ); cmap.y = centre.y - KiROUND( sindecideg( radius, StAngle ) ); DPOINT cmap_dev = userToDeviceCoordinates( cmap ); DPOINT cmap_dev = userToDeviceCoordinates( cmap ); fprintf( outputFile, fprintf( outputFile, Loading Loading @@ -431,10 +431,8 @@ void HPGL_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int or */ */ if( size.x > size.y ) if( size.x > size.y ) { { EXCHG( size.x, size.y ); orient += 900; EXCHG( size.x, size.y ); orient = AddAngles( orient, 900 ); if( orient >= 3600 ) orient -= 3600; } } deltaxy = size.y - size.x; // distance between centers of the oval deltaxy = size.y - size.x; // distance between centers of the oval Loading common/common_plotPDF_functions.cpp +6 −9 Original line number Original line Diff line number Diff line Loading @@ -219,23 +219,20 @@ void PDF_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int rad SetCurrentLineWidth( width ); SetCurrentLineWidth( width ); // Usual trig arc plotting routine... // Usual trig arc plotting routine... double alpha = DEG2RAD( StAngle / 10.0 ); start.x = centre.x + KiROUND( cosdecideg( radius, -StAngle ) ); start.x = centre.x + (int) ( radius * cos( -alpha ) ); start.y = centre.y + KiROUND( sindecideg( radius, -StAngle ) ); start.y = centre.y + (int) ( radius * sin( -alpha ) ); DPOINT pos_dev = userToDeviceCoordinates( start ); DPOINT pos_dev = userToDeviceCoordinates( start ); fprintf( workFile, "%g %g m ", pos_dev.x, pos_dev.y ); fprintf( workFile, "%g %g m ", pos_dev.x, pos_dev.y ); for( int ii = StAngle + delta; ii < EndAngle; ii += delta ) for( int ii = StAngle + delta; ii < EndAngle; ii += delta ) { { alpha = DEG2RAD( ii / 10.0 ); end.x = centre.x + KiROUND( cosdecideg( radius, -ii ) ); end.x = centre.x + (int) ( radius * cos( -alpha ) ); end.y = centre.y + KiROUND( sindecideg( radius, -ii ) ); end.y = centre.y + (int) ( radius * sin( -alpha ) ); pos_dev = userToDeviceCoordinates( end ); pos_dev = userToDeviceCoordinates( end ); fprintf( workFile, "%g %g l ", pos_dev.x, pos_dev.y ); fprintf( workFile, "%g %g l ", pos_dev.x, pos_dev.y ); } } alpha = DEG2RAD( EndAngle / 10.0 ); end.x = centre.x + KiROUND( cosdecideg( radius, -EndAngle ) ); end.x = centre.x + (int) ( radius * cos( -alpha ) ); end.y = centre.y + KiROUND( sindecideg( radius, -EndAngle ) ); end.y = centre.y + (int) ( radius * sin( -alpha ) ); pos_dev = userToDeviceCoordinates( end ); pos_dev = userToDeviceCoordinates( end ); fprintf( workFile, "%g %g l ", pos_dev.x, pos_dev.y ); fprintf( workFile, "%g %g l ", pos_dev.x, pos_dev.y ); Loading Loading
common/class_plotter.cpp +2 −4 Original line number Original line Diff line number Diff line Loading @@ -387,7 +387,7 @@ void PLOTTER::segmentAsOval( const wxPoint& start, const wxPoint& end, int width else if( size.x == 0 ) else if( size.x == 0 ) orient = 900; orient = 900; else else orient = -(int) ( RAD2DEG( atan2( (double)size.y, (double)size.x ) ) * 10.0 ); orient = -ArcTangente( size.y, size.x ); size.x = KiROUND( hypot( size.x, size.y ) ) + width; size.x = KiROUND( hypot( size.x, size.y ) ) + width; size.y = width; size.y = width; Loading @@ -407,9 +407,7 @@ void PLOTTER::sketchOval( const wxPoint& pos, const wxSize& aSize, int orient, if( size.x > size.y ) if( size.x > size.y ) { { EXCHG( size.x, size.y ); EXCHG( size.x, size.y ); orient += 900; orient = AddAngles( orient, 900 ); if( orient >= 3600 ) orient -= 3600; } } deltaxy = size.y - size.x; /* distance between centers of the oval */ deltaxy = size.y - size.x; /* distance between centers of the oval */ Loading
common/common_plotDXF_functions.cpp +1 −3 Original line number Original line Diff line number Diff line Loading @@ -423,9 +423,7 @@ void DXF_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int ori if( size.x > size.y ) if( size.x > size.y ) { { EXCHG( size.x, size.y ); EXCHG( size.x, size.y ); orient += 900; orient = AddAngles( orient, 900 ); if( orient >= 3600 ) orient -= 3600; } } sketchOval( pos, size, orient, -1 ); sketchOval( pos, size, orient, -1 ); } } Loading
common/common_plotGERBER_functions.cpp +4 −4 Original line number Original line Diff line number Diff line Loading @@ -287,12 +287,12 @@ void GERBER_PLOTTER::Arc( const wxPoint& aCenter, int aStAngle, int aEndAngle, { { wxASSERT( outputFile ); wxASSERT( outputFile ); wxPoint start, end; wxPoint start, end; start.x = aCenter.x + KiROUND( aRadius*cos( DEG2RAD( aStAngle/10.0 ) ) ); start.x = aCenter.x + KiROUND( cosdecideg( aRadius, aStAngle ) ); start.y = aCenter.y - KiROUND( aRadius*sin( DEG2RAD( aStAngle/10.0 ) ) ); start.y = aCenter.y - KiROUND( sindecideg( aRadius, aStAngle ) ); SetCurrentLineWidth( aWidth ); SetCurrentLineWidth( aWidth ); MoveTo( start ); MoveTo( start ); end.x = aCenter.x + KiROUND( aRadius*cos( DEG2RAD( aEndAngle/10.0 ) ) ); end.x = aCenter.x + KiROUND( cosdecideg( aRadius, aEndAngle ) ); end.y = aCenter.y - KiROUND( aRadius*sin( DEG2RAD( aEndAngle/10.0 ) ) ); end.y = aCenter.y - KiROUND( sindecideg( aRadius, aEndAngle ) ); DPOINT devEnd = userToDeviceCoordinates( end ); DPOINT devEnd = userToDeviceCoordinates( end ); DPOINT devCenter = userToDeviceCoordinates( aCenter ) DPOINT devCenter = userToDeviceCoordinates( aCenter ) - userToDeviceCoordinates( start ); - userToDeviceCoordinates( start ); Loading
common/common_plotHPGL_functions.cpp +4 −6 Original line number Original line Diff line number Diff line Loading @@ -401,8 +401,8 @@ void HPGL_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int ra // Calculate start point, // Calculate start point, wxPoint cmap; wxPoint cmap; cmap.x = int( centre.x + ( radius * cos( DEG2RAD( StAngle / 10.0 ) ) ) ); cmap.x = centre.x + KiROUND( cosdecideg( radius, StAngle ) ); cmap.y = int( centre.y - ( radius * sin( DEG2RAD( StAngle / 10.0 ) ) ) ); cmap.y = centre.y - KiROUND( sindecideg( radius, StAngle ) ); DPOINT cmap_dev = userToDeviceCoordinates( cmap ); DPOINT cmap_dev = userToDeviceCoordinates( cmap ); fprintf( outputFile, fprintf( outputFile, Loading Loading @@ -431,10 +431,8 @@ void HPGL_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, int or */ */ if( size.x > size.y ) if( size.x > size.y ) { { EXCHG( size.x, size.y ); orient += 900; EXCHG( size.x, size.y ); orient = AddAngles( orient, 900 ); if( orient >= 3600 ) orient -= 3600; } } deltaxy = size.y - size.x; // distance between centers of the oval deltaxy = size.y - size.x; // distance between centers of the oval Loading
common/common_plotPDF_functions.cpp +6 −9 Original line number Original line Diff line number Diff line Loading @@ -219,23 +219,20 @@ void PDF_PLOTTER::Arc( const wxPoint& centre, int StAngle, int EndAngle, int rad SetCurrentLineWidth( width ); SetCurrentLineWidth( width ); // Usual trig arc plotting routine... // Usual trig arc plotting routine... double alpha = DEG2RAD( StAngle / 10.0 ); start.x = centre.x + KiROUND( cosdecideg( radius, -StAngle ) ); start.x = centre.x + (int) ( radius * cos( -alpha ) ); start.y = centre.y + KiROUND( sindecideg( radius, -StAngle ) ); start.y = centre.y + (int) ( radius * sin( -alpha ) ); DPOINT pos_dev = userToDeviceCoordinates( start ); DPOINT pos_dev = userToDeviceCoordinates( start ); fprintf( workFile, "%g %g m ", pos_dev.x, pos_dev.y ); fprintf( workFile, "%g %g m ", pos_dev.x, pos_dev.y ); for( int ii = StAngle + delta; ii < EndAngle; ii += delta ) for( int ii = StAngle + delta; ii < EndAngle; ii += delta ) { { alpha = DEG2RAD( ii / 10.0 ); end.x = centre.x + KiROUND( cosdecideg( radius, -ii ) ); end.x = centre.x + (int) ( radius * cos( -alpha ) ); end.y = centre.y + KiROUND( sindecideg( radius, -ii ) ); end.y = centre.y + (int) ( radius * sin( -alpha ) ); pos_dev = userToDeviceCoordinates( end ); pos_dev = userToDeviceCoordinates( end ); fprintf( workFile, "%g %g l ", pos_dev.x, pos_dev.y ); fprintf( workFile, "%g %g l ", pos_dev.x, pos_dev.y ); } } alpha = DEG2RAD( EndAngle / 10.0 ); end.x = centre.x + KiROUND( cosdecideg( radius, -EndAngle ) ); end.x = centre.x + (int) ( radius * cos( -alpha ) ); end.y = centre.y + KiROUND( sindecideg( radius, -EndAngle ) ); end.y = centre.y + (int) ( radius * sin( -alpha ) ); pos_dev = userToDeviceCoordinates( end ); pos_dev = userToDeviceCoordinates( end ); fprintf( workFile, "%g %g l ", pos_dev.x, pos_dev.y ); fprintf( workFile, "%g %g l ", pos_dev.x, pos_dev.y ); Loading