From 22548e97b7fd38308c9aacea4c865491d84562a6 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Wed, 25 Sep 2013 00:47:22 +0200 Subject: Simplified some in-code circle creation. (bzr r11608.1.131) --- src/dyna-draw-context.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/dyna-draw-context.cpp') diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp index 3e35c0ac1..01f71f76a 100644 --- a/src/dyna-draw-context.cpp +++ b/src/dyna-draw-context.cpp @@ -38,6 +38,7 @@ #include <2geom/math-utils.h> #include <2geom/pathvector.h> #include <2geom/bezier-utils.h> +#include <2geom/circle.h> #include "display/curve.h" #include #include "macros.h" @@ -151,17 +152,11 @@ void SPDynaDrawContext::setup() { g_signal_connect(G_OBJECT(this->currentshape), "event", G_CALLBACK(sp_desktop_root_handler), this->desktop); { - /* TODO: this can be done either with an arcto, and should maybe also be put in a general file (other tools use this as well) */ - SPCurve *c = new SPCurve(); + /* TODO: have a look at SPDropperContext::setup where the same is done.. generalize? */ + Geom::PathVector path; + Geom::Circle(0, 0, 1).getPath(path); - const double C1 = 0.552; - - c->moveto(-1,0); - c->curveto(-1, C1, -C1, 1, 0, 1 ); - c->curveto(C1, 1, 1, C1, 1, 0 ); - c->curveto(1, -C1, C1, -1, 0, -1 ); - c->curveto(-C1, -1, -1, -C1, -1, 0 ); - c->closepath(); + SPCurve *c = new SPCurve(path); this->hatch_area = sp_canvas_bpath_new(sp_desktop_controls(this->desktop), c); -- cgit v1.2.3