summaryrefslogtreecommitdiffstats
path: root/src/2geom/point.cpp
diff options
context:
space:
mode:
authorJF Barraud <jf.barraud@gmail.com>2009-03-09 01:47:39 +0000
committerjfbarraud <jfbarraud@users.sourceforge.net>2009-03-09 01:47:39 +0000
commitfffb14c92df4ff0efb9271708984c75ca12b30d6 (patch)
tree04a75637990939efdd4da28826357ff214bafc22 /src/2geom/point.cpp
parentpart of bug #339660; can not use Add/Rename dialog to create layer with no pr... (diff)
downloadinkscape-fffb14c92df4ff0efb9271708984c75ca12b30d6.tar.gz
inkscape-fffb14c92df4ff0efb9271708984c75ca12b30d6.zip
2geom update
(bzr r7453)
Diffstat (limited to '')
-rw-r--r--src/2geom/point.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/2geom/point.cpp b/src/2geom/point.cpp
index b8a858f8d..4a0625713 100644
--- a/src/2geom/point.cpp
+++ b/src/2geom/point.cpp
@@ -150,19 +150,19 @@ Point &Point::operator*=(Matrix const &m)
return *this;
}
-Point constrain_angle(Point const &ref, Point const &pt, unsigned int n, Point const &dir)
+Point constrain_angle(Point const &A, Point const &B, unsigned int n, Point const &dir)
{
- // for special cases we could perhaps use faster routines
+ // for special cases we could perhaps use explicit testing (which might be faster)
if (n == 0.0) {
- return pt;
+ return B;
}
- Point diff(pt - ref);
+ Point diff(B - A);
double angle = -angle_between(diff, dir);
double k = round(angle * (double)n / (2.0*M_PI));
- return ref + dir * Rotate(k * 2.0 * M_PI / (double)n) * L2(diff);
+ return A + dir * Rotate(k * 2.0 * M_PI / (double)n) * L2(diff);
}
-} //Namespace Geom
+} //namespace Geom
/*
Local Variables: