summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-bendpath.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-08-07 17:45:53 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-08-07 17:45:53 +0000
commit238f18ff7d05d690b399da7cf62305cbf748700e (patch)
tree265f4bb08a1e63e65eed8cedc3f09e6d85921e3a /src/live_effects/lpe-bendpath.cpp
parentKhmer translation updated (diff)
downloadinkscape-238f18ff7d05d690b399da7cf62305cbf748700e.tar.gz
inkscape-238f18ff7d05d690b399da7cf62305cbf748700e.zip
try to make LPE optimizations easier. example in LPE Bend
(bzr r6584)
Diffstat (limited to 'src/live_effects/lpe-bendpath.cpp')
-rw-r--r--src/live_effects/lpe-bendpath.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/live_effects/lpe-bendpath.cpp b/src/live_effects/lpe-bendpath.cpp
index 47d029d60..fb305130d 100644
--- a/src/live_effects/lpe-bendpath.cpp
+++ b/src/live_effects/lpe-bendpath.cpp
@@ -83,14 +83,19 @@ LPEBendPath::doBeforeEffect (SPLPEItem *lpeitem)
Geom::Piecewise<Geom::D2<Geom::SBasis> >
LPEBendPath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in)
{
+g_message("doEffect_pwd2");
using namespace Geom;
/* Much credit should go to jfb and mgsloan of lib2geom development for the code below! */
- Piecewise<D2<SBasis> > uskeleton = arc_length_parametrization(Piecewise<D2<SBasis> >(bend_path.get_pwd2()),2,.1);
- uskeleton = remove_short_cuts(uskeleton,.01);
- Piecewise<D2<SBasis> > n = rot90(derivative(uskeleton));
- n = force_continuity(remove_short_cuts(n,.1));
+ if (bend_path.changed) {
+ uskeleton = arc_length_parametrization(Piecewise<D2<SBasis> >(bend_path.get_pwd2()),2,.1);
+ uskeleton = remove_short_cuts(uskeleton,.01);
+ n = rot90(derivative(uskeleton));
+ n = force_continuity(remove_short_cuts(n,.1));
+
+ bend_path.changed = false;
+ }
D2<Piecewise<SBasis> > patternd2 = make_cuts_independent(pwd2_in);
Piecewise<SBasis> x = vertical_pattern.get_value() ? Piecewise<SBasis>(patternd2[1]) : Piecewise<SBasis>(patternd2[0]);