From 8a082e274bc322596c217bbe7770904a3cb50cc2 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sat, 29 Mar 2014 15:28:44 -0400 Subject: Fix build errors and a few small bugs (bzr r13090.1.36) --- src/live_effects/lpe-taperstroke.cpp | 4 ++-- .../parameter/powerstrokepointarray.cpp | 2 +- src/live_effects/pathoutlineprovider.cpp | 25 ++++++++++++++++++---- 3 files changed, 24 insertions(+), 7 deletions(-) mode change 100644 => 100755 src/live_effects/lpe-taperstroke.cpp (limited to 'src') diff --git a/src/live_effects/lpe-taperstroke.cpp b/src/live_effects/lpe-taperstroke.cpp old mode 100644 new mode 100755 index 8e6edfa2f..0e9752d31 --- a/src/live_effects/lpe-taperstroke.cpp +++ b/src/live_effects/lpe-taperstroke.cpp @@ -279,10 +279,10 @@ Geom::PathVector LPETaperStroke::doEffect_path(Geom::PathVector const& path_in) //don't let it be integer if (double(unsigned(attach_start)) == attach_start) { - attach_start.param_set_value(attach_start - 0.00000001); + attach_start.param_set_value(attach_start - 0.00001); } if (double(unsigned(attach_end)) == attach_end) { - attach_end.param_set_value(attach_end - 0.00000001); + attach_end.param_set_value(attach_end - 0.00001); } unsigned allowed_start = first_cusp.size(); diff --git a/src/live_effects/parameter/powerstrokepointarray.cpp b/src/live_effects/parameter/powerstrokepointarray.cpp index 7fa837689..4ed8998fa 100644 --- a/src/live_effects/parameter/powerstrokepointarray.cpp +++ b/src/live_effects/parameter/powerstrokepointarray.cpp @@ -202,7 +202,7 @@ PowerStrokePointArrayParamKnotHolderEntity::knot_get() const void PowerStrokePointArrayParamKnotHolderEntity::knot_set_offset(Geom::Point offset) { _pparam->_vector.at(_index) = Geom::Point(offset.x(), offset.y() / 2); - this->parent_holder->knot_ungrabbed_handler(this->knot); + this->parent_holder->knot_ungrabbed_handler(this->knot, 0); } void diff --git a/src/live_effects/pathoutlineprovider.cpp b/src/live_effects/pathoutlineprovider.cpp index a5a7a044f..2a0da05b4 100755 --- a/src/live_effects/pathoutlineprovider.cpp +++ b/src/live_effects/pathoutlineprovider.cpp @@ -220,8 +220,8 @@ bool outside_angle (const Geom::Curve& cbc1, const Geom::Curve& cbc2) void extrapolate_curves(Geom::Path& path_builder, Geom::Curve* cbc1, Geom::Curve* cbc2, Geom::Point endPt, double miter_limit, bool outside = false) { - - if ( outside ) { + bool lineProblem = (dynamic_cast *>(cbc1)) || (dynamic_cast *>(cbc2)); + if ( outside && !lineProblem ) { Geom::Path pth; pth.append(*cbc1); @@ -273,9 +273,26 @@ void extrapolate_curves(Geom::Path& path_builder, Geom::Curve* cbc1, Geom::Curve } path_builder.appendNew (endPt); } - } else { + } + if ( outside && lineProblem ) { + Geom::Path pth; + pth.append(*cbc1); + Geom::Point tang1 = Geom::unitTangentAt(Geom::reverse(pth.toPwSb()[0]), 0.); + pth = Geom::Path(); + pth.append( *cbc2 ); + Geom::Point tang2 = Geom::unitTangentAt(pth.toPwSb()[0], 0); + + boost::optional p = intersection_point (cbc1->finalPoint(), tang1, + cbc2->initialPoint(), tang2); + if (p) + { + path_builder.appendNew (*p); + } path_builder.appendNew (endPt); - } + } + if ( !outside ) { + path_builder.appendNew (endPt); + } } void reflect_curves(Geom::Path& path_builder, Geom::Curve* cbc1, Geom::Curve* cbc2, Geom::Point endPt, double miter_limit, bool outside = false) -- cgit v1.2.3