fixes angle calculation (on mac ALWAYS clockwise)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30112 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2004-10-27 07:45:32 +00:00
parent ffa0583fbf
commit a99915c224

View File

@@ -781,8 +781,8 @@ void wxDC::DoCrossHair( wxCoord x, wxCoord y )
static double wxConvertWXangleToMACangle(double angle) static double wxConvertWXangleToMACangle(double angle)
{ {
double newAngle = 90 - angle ; double newAngle = 90 - angle ;
if ( newAngle < 0 ) while ( newAngle > 360 ) newAngle -= 360 ;
newAngle += 360 ; while ( newAngle < 0 ) newAngle += 360 ;
return newAngle ; return newAngle ;
} }
@@ -823,9 +823,8 @@ void wxDC::DoDrawArc( wxCoord x1, wxCoord y1,
} }
wxCoord alpha2 = wxCoord(radius2 - radius1); wxCoord alpha2 = wxCoord(radius2 - radius1);
wxCoord alpha1 = wxCoord(wxConvertWXangleToMACangle(radius1)); wxCoord alpha1 = wxCoord(wxConvertWXangleToMACangle(radius1));
if( (xx1 > xx2) || (yy1 > yy2) ) { while( alpha2 < 0 ) alpha2 += 360 ;
alpha2 *= -1; alpha2 = -alpha2 ;
}
Rect r = { yyc - rad, xxc - rad, yyc + rad, xxc + rad }; Rect r = { yyc - rad, xxc - rad, yyc + rad, xxc + rad };
if(m_brush.GetStyle() != wxTRANSPARENT) { if(m_brush.GetStyle() != wxTRANSPARENT) {
MacInstallBrush(); MacInstallBrush();