diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-04-09 20:34:47 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-04-09 20:34:47 +0000 |
| commit | 232083aa5e3b3aec3c49612c793dd12dda20f740 (patch) | |
| tree | 7dd14b8e2474812e4fc7182f5f2873ba5b383563 /src/live_effects/effect.cpp | |
| parent | Fixed Makefile following earlier commit (removed and added relevant .py files) (diff) | |
| download | inkscape-232083aa5e3b3aec3c49612c793dd12dda20f740.tar.gz inkscape-232083aa5e3b3aec3c49612c793dd12dda20f740.zip | |
change doEffect_path to default to calling pwd2 for all continuous subpaths
(bzr r5392)
Diffstat (limited to 'src/live_effects/effect.cpp')
| -rw-r--r-- | src/live_effects/effect.cpp | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 51a59f1a1..d8a48535a 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -123,6 +123,7 @@ Effect::New(EffectType lpenr, LivePathEffectObject *lpeobj) } Effect::Effect(LivePathEffectObject *lpeobject) + : concatenate_before_pwd2(false) { lpeobj = lpeobject; oncanvasedit_it = 0; @@ -198,16 +199,29 @@ Effect::doEffect_nartbpath (NArtBpath * path_in) std::vector<Geom::Path> Effect::doEffect_path (std::vector<Geom::Path> & path_in) { - Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2_in; - - for (unsigned int i=0; i < path_in.size(); i++) { - pwd2_in.concat( path_in[i].toPwSb() ); + std::vector<Geom::Path> path_out; + + if ( !concatenate_before_pwd2 ) { + // default behavior + for (unsigned int i=0; i < path_in.size(); i++) { + Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2_in = path_in[i].toPwSb(); + Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2_out = doEffect_pwd2(pwd2_in); + std::vector<Geom::Path> path = Geom::path_from_piecewise( pwd2_out, LPE_CONVERSION_TOLERANCE); + // add the output path vector to the already accumulated vector: + for (unsigned int j=0; j < path.size(); j++) { + path_out.push_back(path[j]); + } + } + } else { + // concatenate the path into possibly discontinuous pwd2 + Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2_in; + for (unsigned int i=0; i < path_in.size(); i++) { + pwd2_in.concat( path_in[i].toPwSb() ); + } + Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2_out = doEffect_pwd2(pwd2_in); + path_out = Geom::path_from_piecewise( pwd2_out, LPE_CONVERSION_TOLERANCE); } - Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2_out = doEffect_pwd2(pwd2_in); - - std::vector<Geom::Path> path_out = Geom::path_from_piecewise( pwd2_out, LPE_CONVERSION_TOLERANCE); - return path_out; } |
