summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-curvestitch.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-03-23 19:23:08 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-03-23 19:23:08 +0000
commitd788700346e4aa68855180315d5120728f2e4bdd (patch)
tree3f7ea2876d9486dbd5f7cd8dca9b8d6eabeafae8 /src/live_effects/lpe-curvestitch.cpp
parentexpand visual bbox for item with a filter (diff)
downloadinkscape-d788700346e4aa68855180315d5120728f2e4bdd.tar.gz
inkscape-d788700346e4aa68855180315d5120728f2e4bdd.zip
remove multiple inheritance from lpe PathParam. since it is often desired to get the path not as pw< d2<> >, but also as geom::path or maybe as dw< pw<> >. Plus this enabled linking to an object, instead of keeping its own path data. (i.e. linking to other objects)
(bzr r5176)
Diffstat (limited to 'src/live_effects/lpe-curvestitch.cpp')
-rw-r--r--src/live_effects/lpe-curvestitch.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/live_effects/lpe-curvestitch.cpp b/src/live_effects/lpe-curvestitch.cpp
index 85d6e5e8f..dc9cfe635 100644
--- a/src/live_effects/lpe-curvestitch.cpp
+++ b/src/live_effects/lpe-curvestitch.cpp
@@ -80,7 +80,7 @@ LPECurveStitch::doEffect_path (std::vector<Geom::Path> & path_in)
startpoint_spacing_variation.resetRandomizer();
endpoint_spacing_variation.resetRandomizer();
- D2<Piecewise<SBasis> > stroke = make_cuts_independant(strokepath);
+ D2<Piecewise<SBasis> > stroke = make_cuts_independant(strokepath.get_pwd2());
Interval bndsStroke = bounds_exact(stroke[0]);
gdouble scaling = bndsStroke.max() - bndsStroke.min();
Interval bndsStrokeY = bounds_exact(stroke[1]);
@@ -123,7 +123,7 @@ LPECurveStitch::doEffect_path (std::vector<Geom::Path> & path_in)
transform.setXAxis( (end-start) / scaling );
transform.setYAxis( rot90(unit_vector(end-start)) * scaling_y);
transform.setTranslation( start );
- Piecewise<D2<SBasis> > pwd2_out = (strokepath-stroke_origin) * transform;
+ Piecewise<D2<SBasis> > pwd2_out = (strokepath.get_pwd2()-stroke_origin) * transform;
// add stuff to one big pw<d2<sbasis> > and then outside the loop convert to path?
// No: this way, the separate result paths are kept separate which might come in handy some time!
@@ -157,12 +157,13 @@ LPECurveStitch::resetDefaults(SPItem * item)
using namespace Geom;
// set the stroke path to run horizontally in the middle of the bounding box of the original path
+
+ // calculate bounding box: (isn't there a simpler way?)
Piecewise<D2<SBasis> > pwd2;
std::vector<Geom::Path> temppath = SVGD_to_2GeomPath( SP_OBJECT_REPR(item)->attribute("inkscape:original-d"));
for (unsigned int i=0; i < temppath.size(); i++) {
pwd2.concat( temppath[i].toPwSb() );
}
-
D2<Piecewise<SBasis> > d2pw = make_cuts_independant(pwd2);
Interval bndsX = bounds_exact(d2pw[0]);
Interval bndsY = bounds_exact(d2pw[1]);