summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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;
}