diff options
| author | Liam P. White <inkscapebronyat-signgmaildotcom> | 2014-03-29 19:28:44 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebronyat-signgmaildotcom> | 2014-03-29 19:28:44 +0000 |
| commit | 8a082e274bc322596c217bbe7770904a3cb50cc2 (patch) | |
| tree | f4910f4b21f6072c299299a8b37cee02726b5c30 /src/live_effects/pathoutlineprovider.cpp | |
| parent | Update to trunk (diff) | |
| download | inkscape-8a082e274bc322596c217bbe7770904a3cb50cc2.tar.gz inkscape-8a082e274bc322596c217bbe7770904a3cb50cc2.zip | |
Fix build errors and a few small bugs
(bzr r13090.1.36)
Diffstat (limited to 'src/live_effects/pathoutlineprovider.cpp')
| -rwxr-xr-x | src/live_effects/pathoutlineprovider.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
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<Geom::BezierCurveN<1u> *>(cbc1)) || (dynamic_cast<Geom::BezierCurveN<1u> *>(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<Geom::LineSegment> (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 <Geom::Point> p = intersection_point (cbc1->finalPoint(), tang1,
+ cbc2->initialPoint(), tang2);
+ if (p)
+ {
+ path_builder.appendNew<Geom::LineSegment> (*p);
+ }
path_builder.appendNew<Geom::LineSegment> (endPt);
- }
+ }
+ if ( !outside ) {
+ path_builder.appendNew<Geom::LineSegment> (endPt);
+ }
}
void reflect_curves(Geom::Path& path_builder, Geom::Curve* cbc1, Geom::Curve* cbc2, Geom::Point endPt, double miter_limit, bool outside = false)
|
