From a99915c22412e895a3dde8cea04001abb0198ba1 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 27 Oct 2004 07:45:32 +0000 Subject: [PATCH] fixes angle calculation (on mac ALWAYS clockwise) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30112 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/dc.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/mac/carbon/dc.cpp b/src/mac/carbon/dc.cpp index 6ba16965dc..4e570147ca 100644 --- a/src/mac/carbon/dc.cpp +++ b/src/mac/carbon/dc.cpp @@ -781,8 +781,8 @@ void wxDC::DoCrossHair( wxCoord x, wxCoord y ) static double wxConvertWXangleToMACangle(double angle) { double newAngle = 90 - angle ; - if ( newAngle < 0 ) - newAngle += 360 ; + while ( newAngle > 360 ) newAngle -= 360 ; + while ( newAngle < 0 ) newAngle += 360 ; return newAngle ; } @@ -823,9 +823,8 @@ void wxDC::DoDrawArc( wxCoord x1, wxCoord y1, } wxCoord alpha2 = wxCoord(radius2 - radius1); wxCoord alpha1 = wxCoord(wxConvertWXangleToMACangle(radius1)); - if( (xx1 > xx2) || (yy1 > yy2) ) { - alpha2 *= -1; - } + while( alpha2 < 0 ) alpha2 += 360 ; + alpha2 = -alpha2 ; Rect r = { yyc - rad, xxc - rad, yyc + rad, xxc + rad }; if(m_brush.GetStyle() != wxTRANSPARENT) { MacInstallBrush();