diff options
author | nyamatongwe <nyamatongwe@gmail.com> | 2013-07-21 19:50:44 +1000 |
---|---|---|
committer | nyamatongwe <nyamatongwe@gmail.com> | 2013-07-21 19:50:44 +1000 |
commit | a0509d30038411681d7b285d02e5e3ba4d6ee06a (patch) | |
tree | 7188eba156a87b48cf2d4ed6aa94f44f36d460d4 | |
parent | 86b7b24361de29143c12b777409a207d9235098a (diff) | |
download | scintilla-mirror-a0509d30038411681d7b285d02e5e3ba4d6ee06a.tar.gz |
Replaced M_PI with a local constant kPi since M_PI is not defined by ISO C/C++.
-rw-r--r-- | gtk/PlatGTK.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index a6ae84e10..9cd782629 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -46,6 +46,8 @@ #define IS_WIDGET_FOCUSSED(w) (GTK_WIDGET_HAS_FOCUS(w)) #endif +static const double kPi = 3.14159265358979323846; + // The Pango version guard for pango_units_from_double and pango_units_to_double // is more complex than simply implementing these here. @@ -739,7 +741,7 @@ void SurfaceImpl::RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesi } static void PathRoundRectangle(cairo_t *context, double left, double top, double width, double height, int radius) { - double degrees = M_PI / 180.0; + double degrees = kPi / 180.0; #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) cairo_new_sub_path(context); @@ -820,7 +822,7 @@ void SurfaceImpl::DrawRGBAImage(PRectangle rc, int width, int height, const unsi void SurfaceImpl::Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back) { PenColour(back); cairo_arc(context, (rc.left + rc.right) / 2 + 0.5, (rc.top + rc.bottom) / 2 + 0.5, - Platform::Minimum(rc.Width(), rc.Height()) / 2, 0, 2*M_PI); + Platform::Minimum(rc.Width(), rc.Height()) / 2, 0, 2*kPi); cairo_fill_preserve(context); PenColour(fore); cairo_stroke(context); |