diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-11-12 17:10:11 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-11-12 17:10:11 +0000 |
| commit | db164d8341a6dca5cab6fdc4576234bc656ac6f7 (patch) | |
| tree | 97468a0fabde7cc31d12ce9e63866033e446d4ad /src/live_effects | |
| parent | Merge branch 'master' into powerpencil (diff) | |
| download | inkscape-db164d8341a6dca5cab6fdc4576234bc656ac6f7.tar.gz inkscape-db164d8341a6dca5cab6fdc4576234bc656ac6f7.zip | |
Base refactor
Diffstat (limited to 'src/live_effects')
| -rw-r--r-- | src/live_effects/lpe-powerstroke.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/live_effects/lpe-powerstroke.cpp b/src/live_effects/lpe-powerstroke.cpp index 51c8451a5..7c060a965 100644 --- a/src/live_effects/lpe-powerstroke.cpp +++ b/src/live_effects/lpe-powerstroke.cpp @@ -563,13 +563,19 @@ LPEPowerStroke::doEffect_path (Geom::PathVector const & path_in) Geom::PathVector path_out; if (path_in.empty()) { - return path_out; + return path_in; } Geom::PathVector pathv = pathv_to_linear_and_cubic_beziers(path_in); Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2_in = pathv[0].toPwSb(); + if (!pwd2_in.size()) { + return path_in; + } Piecewise<D2<SBasis> > der = derivative(pwd2_in); + if (!der.size()) { + return path_in; + } Piecewise<D2<SBasis> > n = unitVector(der,0.0001); - if (!n.size() || !pwd2_in.size() || !n.size()) { + if (!n.size()) { return path_in; } n = rot90(n); @@ -639,10 +645,8 @@ LPEPowerStroke::doEffect_path (Geom::PathVector const & path_in) } LineJoinType jointype = static_cast<LineJoinType>(linejoin_type.get_value()); - - Piecewise<D2<SBasis> > pwd2_out = compose(pwd2_in,x) + y*compose(n,x); + Piecewise<D2<SBasis> > pwd2_out = compose(pwd2_in,x) + y*compose(n,x); Piecewise<D2<SBasis> > mirrorpath = reverse( compose(pwd2_in,x) - y*compose(n,x)); - Geom::Path fixed_path = path_from_piecewise_fix_cusps( pwd2_out, y, jointype, miter_limit, LPE_CONVERSION_TOLERANCE); Geom::Path fixed_mirrorpath = path_from_piecewise_fix_cusps( mirrorpath, reverse(y), jointype, miter_limit, LPE_CONVERSION_TOLERANCE); if (pathv[0].closed()) { |
