diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2007-11-18 13:59:34 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2007-11-18 13:59:34 +0000 |
| commit | b337a5de023075fc3916baee97218c72f95b7fdd (patch) | |
| tree | 04bc9d473c8b0a104997366e331a09e5891f9643 /src/live_effects/lpe-pathalongpath.cpp | |
| parent | further work on the gtkmm exception problems in the file dialog/filedialogimp... (diff) | |
| download | inkscape-b337a5de023075fc3916baee97218c72f95b7fdd.tar.gz inkscape-b337a5de023075fc3916baee97218c72f95b7fdd.zip | |
Make LPE Path along path behave more naturally. (fixes problems in moving a path with that effect applied to it)
(bzr r4107)
Diffstat (limited to 'src/live_effects/lpe-pathalongpath.cpp')
| -rw-r--r-- | src/live_effects/lpe-pathalongpath.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/live_effects/lpe-pathalongpath.cpp b/src/live_effects/lpe-pathalongpath.cpp index 499b77f8c..7138b6faa 100644 --- a/src/live_effects/lpe-pathalongpath.cpp +++ b/src/live_effects/lpe-pathalongpath.cpp @@ -102,6 +102,9 @@ LPEPathAlongPath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2 Piecewise<D2<SBasis> > uskeleton = arc_length_parametrization(Piecewise<D2<SBasis> >(bend_path),2,.1);
uskeleton = remove_short_cuts(uskeleton,.01);
+ Rect uskeletonbounds = bounds_exact(uskeleton);
+ uskeleton -= uskeletonbounds.midpoint();
+
Piecewise<D2<SBasis> > n = rot90(derivative(uskeleton));
n = force_continuity(remove_short_cuts(n,.1));
@@ -111,7 +114,7 @@ LPEPathAlongPath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2 Interval pattBnds = bounds_exact(x);
x -= pattBnds.min();
Interval pattBndsY = bounds_exact(y);
- y -= (pattBndsY.max()+pattBndsY.min())/2;
+ y -= pattBndsY.middle();
int nbCopies = int(uskeleton.cuts.back()/pattBnds.extent());
double scaling = 1;
@@ -154,6 +157,9 @@ LPEPathAlongPath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2 output.concat(compose(uskeleton,x+offs)+y*compose(n,x+offs));
offs+=pattWidth;
}
+
+ output += Point(pattBnds.middle(), pattBndsY.middle());
+
return output;
}
|
