From dffe9db7d2ce4dd27d03e19faa91bfcf34113d85 Mon Sep 17 00:00:00 2001 From: cilix42 Date: Wed, 2 Apr 2008 11:19:54 +0000 Subject: [PATCH] Increase precision for circle LPE so that the output is actually a circle :) --- src/live_effects/lpe-circle_with_radius.cpp | 25 +++++++++------------ 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/live_effects/lpe-circle_with_radius.cpp b/src/live_effects/lpe-circle_with_radius.cpp index 63e3dfa8a..ec9d4f74d 100644 --- a/src/live_effects/lpe-circle_with_radius.cpp +++ b/src/live_effects/lpe-circle_with_radius.cpp @@ -48,36 +48,33 @@ LPECircleWithRadius::~LPECircleWithRadius() } +void _circle(Geom::Point center, double radius, std::vector &path_out) { + Geom::Path pb; -/* ######################## - * Choose to implement one of the doEffect functions. You can delete or comment out the others. -*/ - -D2 _circle(Geom::Point center, double radius) { D2 B; Linear bo = Linear(0, 2 * M_PI); - B[0] = cos(bo,2); - B[1] = sin(bo,2); + B[0] = cos(bo,4); + B[1] = sin(bo,4); + + B = B * radius + center; + + pb.append(SBasisCurve(B)); - B = B*radius + center; - return B; + path_out.push_back(pb); } std::vector -LPECircleWithRadius::doEffect_path (std::vector & path_in) +LPECircleWithRadius::doEffect_path (std::vector &path_in) { std::vector path_out = std::vector(); - Geom::Path pb; Geom::Point center = path_in[0].initialPoint(); Geom::Point pt = path_in[0].finalPoint(); double radius = Geom::L2(pt - center); - pb.append(SBasisCurve(_circle(center, radius))); - - path_out.push_back(pb); + _circle(center, radius, path_out); return path_out; } -- 2.30.2