From b7c42a14e19393318be0031b6c75443dd34f9b43 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Fri, 3 Apr 2015 21:40:44 +0200 Subject: Add helper path to guide BSpline if path outline is hidden (bzr r14042) --- src/live_effects/lpe-bspline.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/live_effects/lpe-bspline.cpp b/src/live_effects/lpe-bspline.cpp index dba501f42..5d5a6e616 100644 --- a/src/live_effects/lpe-bspline.cpp +++ b/src/live_effects/lpe-bspline.cpp @@ -74,13 +74,15 @@ void LPEBSpline::doEffect(SPCurve *curve) } // Make copy of old path as it is changed during processing Geom::PathVector const original_pathv = curve->get_pathvector(); + curve->reset(); for (Geom::PathVector::const_iterator path_it = original_pathv.begin(); path_it != original_pathv.end(); ++path_it) { - if (path_it->empty()) + if (path_it->empty()){ continue; - + } + hp.push_back(*path_it); Geom::Path::const_iterator curve_it1 = path_it->begin(); Geom::Path::const_iterator curve_it2 = ++(path_it->begin()); Geom::Path::const_iterator curve_endit = path_it->end_default(); -- cgit v1.2.3 From ffdf1e9b2ecc1be4469678d0fbe7120bb709e3cc Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Sat, 4 Apr 2015 08:51:44 +0200 Subject: Call decide() with subpaths in proper order. (bzr r14043) --- src/helper/geom-pathstroke.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/helper/geom-pathstroke.cpp b/src/helper/geom-pathstroke.cpp index 56200402b..4b5a437b2 100644 --- a/src/helper/geom-pathstroke.cpp +++ b/src/helper/geom-pathstroke.cpp @@ -720,7 +720,7 @@ Geom::Path half_outline(Geom::Path const& input, double width, double miter, Lin if (u == 0) { res.append(temp); } else { - bool on_outside = decide(input[u], input[u-1]); + bool on_outside = decide(input[u-1], input[u]); outline_helper(res, temp, width, on_outside, miter, join); if (temp.size() > 0) res.insert(res.end(), ++temp.begin(), temp.end()); -- cgit v1.2.3 From 6c059f826b8e43e0bfb0516e4c9a2ecab77bdacf Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sat, 4 Apr 2015 09:32:14 -0400 Subject: herpderp (bzr r14044) --- src/helper/geom-pathstroke.cpp | 2 +- src/live_effects/lpe-taperstroke.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/helper/geom-pathstroke.cpp b/src/helper/geom-pathstroke.cpp index 4b5a437b2..eb0c432c6 100644 --- a/src/helper/geom-pathstroke.cpp +++ b/src/helper/geom-pathstroke.cpp @@ -411,7 +411,7 @@ void join_inside(Geom::Path& res, Geom::Curve const& outgoing) bool decide(Geom::Curve const& incoming, Geom::Curve const& outgoing) { Geom::Point tang1 = Geom::unitTangentAt(reverse(incoming.toSBasis()), 0.); - Geom::Point tang2 = outgoing.unitTangentAt(0.); + Geom::Point tang2 = outgoing.unitTangentAt(0.); return (Geom::cross(tang1, tang2) < 0); } diff --git a/src/live_effects/lpe-taperstroke.cpp b/src/live_effects/lpe-taperstroke.cpp index bdd36df68..2c74af6d6 100644 --- a/src/live_effects/lpe-taperstroke.cpp +++ b/src/live_effects/lpe-taperstroke.cpp @@ -285,7 +285,7 @@ Geom::PathVector LPETaperStroke::doEffect_path(Geom::PathVector const& path_in) // although this seems obvious, it can probably lead to bugs. if (!metInMiddle) { // append the outside outline of the path (goes with the direction of the path) - throwaway_path = half_outline(pathv_out[1], -fabs(line_width)/2., miter_limit, static_cast(join_type.get_value())); + throwaway_path = half_outline(pathv_out[1], fabs(line_width)/2., miter_limit, static_cast(join_type.get_value())); if (!zeroStart && real_path.size() >= 1 && throwaway_path.size() >= 1) { if (!Geom::are_near(real_path.finalPoint(), throwaway_path.initialPoint())) { real_path.appendNew(throwaway_path.initialPoint()); @@ -317,7 +317,7 @@ Geom::PathVector LPETaperStroke::doEffect_path(Geom::PathVector const& path_in) if (!metInMiddle) { // append the inside outline of the path (against direction) - throwaway_path = half_outline(pathv_out[1].reverse(), -fabs(line_width)/2., miter_limit, static_cast(join_type.get_value())); + throwaway_path = half_outline(pathv_out[1].reverse(), fabs(line_width)/2., miter_limit, static_cast(join_type.get_value())); if (!Geom::are_near(real_path.finalPoint(), throwaway_path.initialPoint()) && real_path.size() >= 1) { real_path.appendNew(throwaway_path.initialPoint()); -- cgit v1.2.3