Add public wxDegToRad() and wxRadToDeg() functions.
Define these functions just once in wx/math.h instead of duplicating them in a dozen of places. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76555 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -23,21 +23,13 @@
|
||||
#include "wx/icon.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#include "wx/math.h"
|
||||
#include "wx/region.h"
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
#include "wx/private/graphics.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Local functions
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
static inline double DegToRad(double deg)
|
||||
{
|
||||
return (deg * M_PI) / 180.0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -470,7 +462,7 @@ void wxGraphicsPathData::AddArcToPoint( wxDouble x1, wxDouble y1 , wxDouble x2,
|
||||
alpha = 360 + alpha;
|
||||
// TODO obtuse angles
|
||||
|
||||
alpha = DegToRad(alpha);
|
||||
alpha = wxDegToRad(alpha);
|
||||
|
||||
wxDouble dist = r / sin(alpha/2) * cos(alpha/2);
|
||||
// calculate tangential points
|
||||
@@ -484,7 +476,7 @@ void wxGraphicsPathData::AddArcToPoint( wxDouble x1, wxDouble y1 , wxDouble x2,
|
||||
wxDouble a2 = v2.GetVectorAngle()-90;
|
||||
|
||||
AddLineToPoint(t1.m_x,t1.m_y);
|
||||
AddArc(c.m_x,c.m_y,r,DegToRad(a1),DegToRad(a2),true);
|
||||
AddArc(c.m_x,c.m_y,r,wxDegToRad(a1),wxDegToRad(a2),true);
|
||||
AddLineToPoint(p2.m_x,p2.m_y);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user