Migrated the interfaces accepting angles to the double type

The plan goes like this:
- eeschema still uses int in decidegrees
- all the other things internally use double in decidegrees (or radians
  in temporaries)
- in pcbnew UI the unit is *still* int in decidegrees

The idea is to have better precision everywhere while keeping the user with int i
angles. Hopefully, if a fractional angle doesn't come in from the outside, everything
should *look* like an integer angle (unless I forgot something and it broke)

When the time comes, simply updating the UI for allowing doubles from the user should
be enough to get arbitrary angles in pcbnew.
This commit is contained in:
Lorenzo Marcantonio
2013-05-05 09:17:48 +02:00
parent 5399b6f438
commit 1e1c2cbb7d
51 changed files with 198 additions and 198 deletions
+9 -8
View File
@@ -746,7 +746,7 @@ void GRCSegm( EDA_RECT* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
}
else
{
int delta_angle = ArcTangente( dy, dx );
double delta_angle = ArcTangente( dy, dx );
dwx = 0;
dwy = width;
RotatePoint( &dwx, &dwy, -delta_angle );
@@ -1107,8 +1107,8 @@ void GRFilledArc( EDA_RECT* ClipBox,
wxDC* DC,
int x,
int y,
int StAngle,
int EndAngle,
double StAngle,
double EndAngle,
int r,
int width,
EDA_COLOR_T Color,
@@ -1153,7 +1153,8 @@ void GRFilledArc( EDA_RECT* ClipBox,
void GRFilledArc( EDA_RECT* ClipBox, wxDC* DC, int x, int y,
int StAngle, int EndAngle, int r, EDA_COLOR_T Color, EDA_COLOR_T BgColor )
double StAngle, double EndAngle, int r,
EDA_COLOR_T Color, EDA_COLOR_T BgColor )
{
GRFilledArc( ClipBox, DC, x, y, StAngle, EndAngle, r, 0, Color, BgColor );
}
@@ -1162,8 +1163,8 @@ void GRFilledArc( EDA_RECT* ClipBox, wxDC* DC, int x, int y,
/*
* Draw an arc in drawing space.
*/
void GRArc( EDA_RECT* ClipBox, wxDC* DC, int xc, int yc, int StAngle,
int EndAngle, int r, EDA_COLOR_T Color )
void GRArc( EDA_RECT* ClipBox, wxDC* DC, int xc, int yc, double StAngle,
double EndAngle, int r, EDA_COLOR_T Color )
{
int x1, y1, x2, y2;
@@ -1210,8 +1211,8 @@ void GRArc( EDA_RECT* ClipBox,
wxDC* DC,
int x,
int y,
int StAngle,
int EndAngle,
double StAngle,
double EndAngle,
int r,
int width,
EDA_COLOR_T Color )