From 25fa09178b7d0d0befa708e93ea5316ef381caa0 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Fri, 22 May 2015 10:23:27 +0200 Subject: Update to 2Geom revision 2396 (bzr r14059.2.16) --- src/2geom/path-sink.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/2geom/path-sink.cpp') 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(); +} + } /* -- cgit v1.2.3