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/tweak-context.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/tweak-context.cpp') diff --git a/src/tweak-context.cpp b/src/tweak-context.cpp index 65106e651..410ea4000 100644 --- a/src/tweak-context.cpp +++ b/src/tweak-context.cpp @@ -74,6 +74,7 @@ #include "display/curve.h" #include "livarot/Shape.h" #include <2geom/transforms.h> +#include <2geom/circle.h> #include "preferences.h" #include "style.h" #include "box3d.h" @@ -271,14 +272,11 @@ void SPTweakContext::setup() { { /* TODO: have a look at sp_dyna_draw_context_setup where the same is done.. generalize? at least make it an arcto! */ - SPCurve *c = new SPCurve(); - 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(); + Geom::PathVector path; + Geom::Circle(0, 0, 1).getPath(path); + + SPCurve *c = new SPCurve(path); + this->dilate_area = sp_canvas_bpath_new(sp_desktop_controls(this->desktop), c); c->unref(); sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(this->dilate_area), 0x00000000,(SPWindRule)0); -- cgit v1.2.3