summaryrefslogtreecommitdiffstats
path: root/src/2geom/path-sink.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2015-05-22 08:23:27 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2015-05-22 08:23:27 +0000
commit25fa09178b7d0d0befa708e93ea5316ef381caa0 (patch)
tree550b4d0d66d0d234b3f49e868cb747987dcc6bf8 /src/2geom/path-sink.cpp
parentMerge from trunk (diff)
downloadinkscape-25fa09178b7d0d0befa708e93ea5316ef381caa0.tar.gz
inkscape-25fa09178b7d0d0befa708e93ea5316ef381caa0.zip
Update to 2Geom revision 2396
(bzr r14059.2.16)
Diffstat (limited to 'src/2geom/path-sink.cpp')
-rw-r--r--src/2geom/path-sink.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/2geom/path-sink.cpp b/src/2geom/path-sink.cpp
index 6ccc21e7b..3b8d407f8 100644
--- a/src/2geom/path-sink.cpp
+++ b/src/2geom/path-sink.cpp
@@ -31,6 +31,8 @@
#include <2geom/sbasis-to-bezier.h>
#include <2geom/path-sink.h>
#include <2geom/exception.h>
+#include <2geom/circle.h>
+#include <2geom/ellipse.h>
namespace Geom {
@@ -68,6 +70,26 @@ void PathSink::feed(Rect const &r) {
closePath();
}
+void PathSink::feed(Circle const &e) {
+ Coord r = e.radius();
+ Point c = e.center();
+ Point a = c + Point(0, c[Y] + r);
+ Point b = c + Point(0, c[Y] - r);
+
+ moveTo(a);
+ arcTo(r, r, 0, false, false, b);
+ arcTo(r, r, 0, false, false, a);
+ closePath();
+}
+
+void PathSink::feed(Ellipse const &e) {
+ Point s = e.pointAt(0);
+ moveTo(s);
+ arcTo(e.ray(X), e.ray(Y), e.rotationAngle(), false, false, e.pointAt(M_PI));
+ arcTo(e.ray(X), e.ray(Y), e.rotationAngle(), false, false, s);
+ closePath();
+}
+
}
/*