From 2f53e4dbb4620edcabaffc964c55cb71090912f8 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Wed, 17 Aug 2016 09:39:43 +0200 Subject: Use M_PI, M_PI_2. We use these constants everywhere so if they are not defined we are already in trouble. No need to define them ourselves (except maybe in shared libraries). (bzr r15063) --- src/sp-ellipse.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/sp-ellipse.cpp') diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp index 995f880c2..0d60aa5d8 100644 --- a/src/sp-ellipse.cpp +++ b/src/sp-ellipse.cpp @@ -33,16 +33,10 @@ #include "svg/path-string.h" -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -#define SP_2PI (2 * M_PI) - SPGenericEllipse::SPGenericEllipse() : SPShape() , start(0) - , end(SP_2PI) + , end(M_2_PI) , type(SP_GENERIC_ELLIPSE_UNDEFINED) , _closed(true) { @@ -533,7 +527,7 @@ void SPGenericEllipse::snappoints(std::vector &p, // Snap to the 4 quadrant points of the ellipse, but only if the arc // spans far enough to include them if (snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_ELLIPSE_QUADRANT_POINT)) { - for (double angle = 0; angle < SP_2PI; angle += M_PI_2) { + for (double angle = 0; angle < M_2_PI; angle += M_PI_2) { if (Geom::AngleInterval(this->start, this->end, true).contains(angle)) { Geom::Point pt = this->getPointAtAngle(angle) * i2dt; p.push_back(Inkscape::SnapCandidatePoint(pt, Inkscape::SNAPSOURCE_ELLIPSE_QUADRANT_POINT, Inkscape::SNAPTARGET_ELLIPSE_QUADRANT_POINT)); @@ -668,7 +662,7 @@ bool SPGenericEllipse::_isSlice() const { Geom::AngleInterval a(this->start, this->end, true); - return !(Geom::are_near(a.extent(), 0) || Geom::are_near(a.extent(), SP_2PI)); + return !(Geom::are_near(a.extent(), 0) || Geom::are_near(a.extent(), M_2_PI)); } /* -- cgit v1.2.3