diff options
Diffstat (limited to 'src/helper/geom.cpp')
| -rw-r--r-- | src/helper/geom.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/helper/geom.cpp b/src/helper/geom.cpp index 91689375f..daaf90ff2 100644 --- a/src/helper/geom.cpp +++ b/src/helper/geom.cpp @@ -15,8 +15,7 @@ #include <typeinfo> #include <2geom/pathvector.h> #include <2geom/path.h> -#include <2geom/bezier-curve.h> -#include <2geom/hvlinesegment.h> +#include <2geom/curves.h> #include <2geom/transforms.h> #include <2geom/rect.h> #include <2geom/coord.h> @@ -473,8 +472,8 @@ pathv_to_linear_and_cubic_beziers( Geom::PathVector const &pathv ) for (Geom::PathVector::const_iterator pit = pathv.begin(); pit != pathv.end(); ++pit) { output.push_back( Geom::Path() ); + output.back().setStitching(true); output.back().start( pit->initialPoint() ); - output.back().close( pit->closed() ); for (Geom::Path::const_iterator cit = pit->begin(); cit != pit->end_open(); ++cit) { if (is_straight_curve(*cit)) { @@ -488,10 +487,13 @@ pathv_to_linear_and_cubic_beziers( Geom::PathVector const &pathv ) } else { // convert all other curve types to cubicbeziers Geom::Path cubicbezier_path = Geom::cubicbezierpath_from_sbasis(cit->toSBasis(), 0.1); + cubicbezier_path.close(false); output.back().append(cubicbezier_path); } } } + + output.back().close( pit->closed() ); } return output; @@ -525,8 +527,7 @@ pathv_to_linear( Geom::PathVector const &pathv, double /*maxdisp*/) } else { /* all others must be Bezier curves */ Geom::BezierCurve const *curve = dynamic_cast<Geom::BezierCurve const *>(&*cit); - Geom::CubicBezier b((*curve)[0], (*curve)[1], (*curve)[2], (*curve)[3]); - std::vector<Geom::Point> bzrpoints = b.points(); + std::vector<Geom::Point> bzrpoints = curve->controlPoints(); Geom::Point A = bzrpoints[0]; Geom::Point B = bzrpoints[1]; Geom::Point C = bzrpoints[2]; @@ -584,7 +585,7 @@ pathv_to_cubicbezier( Geom::PathVector const &pathv) pitCubic.appendNew<Geom::LineSegment>( pitCubic.initialPoint() ); pitCubic.close(true); } - for (Geom::Path::const_iterator cit = pitCubic.begin(); cit != pitCubic.end_open(); ++cit) { + for (Geom::Path::iterator cit = pitCubic.begin(); cit != pitCubic.end_open(); ++cit) { if (is_straight_curve(*cit)) { Geom::CubicBezier b(cit->initialPoint(), cit->pointAt(0.3334) + Geom::Point(cubicGap,cubicGap), cit->finalPoint(), cit->finalPoint()); output.back().append(b); |
