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:
@@ -71,8 +71,6 @@ const double RAD2DEG = 180.0 / M_PI;
|
||||
static inline double dmax(double a, double b) { return a > b ? a : b; }
|
||||
static inline double dmin(double a, double b) { return a < b ? a : b; }
|
||||
|
||||
static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// temporary implementation of the missing GDK function
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -1477,7 +1475,7 @@ void wxWindowDCImpl::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord
|
||||
dc.SelectObject(wxNullBitmap);
|
||||
|
||||
// Calculate the size of the rotated bounding box.
|
||||
double rad = DegToRad(angle);
|
||||
double rad = wxDegToRad(angle);
|
||||
double dx = cos(rad),
|
||||
dy = sin(rad);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user