summaryrefslogtreecommitdiffstats
path: root/src/sp-ellipse.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2016-08-17 07:39:43 +0000
committertavmjong-free <tavmjong@free.fr>2016-08-17 07:39:43 +0000
commit2f53e4dbb4620edcabaffc964c55cb71090912f8 (patch)
tree5c7119a28798a5d6b500ad092b92bf10720f80b1 /src/sp-ellipse.cpp
parentAdd std::nothrow so tests of memory allocation work as expected. (diff)
downloadinkscape-2f53e4dbb4620edcabaffc964c55cb71090912f8.tar.gz
inkscape-2f53e4dbb4620edcabaffc964c55cb71090912f8.zip
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)
Diffstat (limited to 'src/sp-ellipse.cpp')
-rw-r--r--src/sp-ellipse.cpp12
1 files changed, 3 insertions, 9 deletions
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<Inkscape::SnapCandidatePoint> &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));
}
/*