summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2008-04-02 11:19:54 +0000
committercilix42 <cilix42@users.sourceforge.net>2008-04-02 11:19:54 +0000
commit74409ab5097c745bea283c330a00aff30ea7910f (patch)
tree3603998ad66b1f4e0df2c2dd15eeb9d219917dfa /src
parentget_single_gaussian_blur_radius() ended without a return value. scalar, so u... (diff)
downloadinkscape-74409ab5097c745bea283c330a00aff30ea7910f.tar.gz
inkscape-74409ab5097c745bea283c330a00aff30ea7910f.zip
Increase precision for circle LPE so that the output is actually a circle :)
(bzr r5308)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-circle_with_radius.cpp25
1 files 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<Geom::Path> &path_out) {
+ Geom::Path pb;
-/* ########################
- * Choose to implement one of the doEffect functions. You can delete or comment out the others.
-*/
-
-D2<SBasis> _circle(Geom::Point center, double radius) {
D2<SBasis> 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<Geom::Path>
-LPECircleWithRadius::doEffect_path (std::vector<Geom::Path> & path_in)
+LPECircleWithRadius::doEffect_path (std::vector<Geom::Path> &path_in)
{
std::vector<Geom::Path> path_out = std::vector<Geom::Path>();
- 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;
}