summaryrefslogtreecommitdiffstats
path: root/src/helper/geom.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-02-05 02:04:47 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2011-02-05 02:04:47 +0000
commitfb749ad5edae38b062e00d1593ec0d306bac4ada (patch)
tree00b1bf94cf1ebf0f81980909d5d9f5e427aed560 /src/helper/geom.cpp
parentProperly fix seltrans brokenness in 2Geom and pull updated files (diff)
downloadinkscape-fb749ad5edae38b062e00d1593ec0d306bac4ada.tar.gz
inkscape-fb749ad5edae38b062e00d1593ec0d306bac4ada.zip
Fix node tool brokenness resulting from a switch to runtime order
in 2Geom's BezierCurve (bzr r10035)
Diffstat (limited to 'src/helper/geom.cpp')
-rw-r--r--src/helper/geom.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/helper/geom.cpp b/src/helper/geom.cpp
index 4bf56f6c1..2420b43b4 100644
--- a/src/helper/geom.cpp
+++ b/src/helper/geom.cpp
@@ -476,15 +476,19 @@ pathv_to_linear_and_cubic_beziers( Geom::PathVector const &pathv )
output.back().close( pit->closed() );
for (Geom::Path::const_iterator cit = pit->begin(); cit != pit->end_open(); ++cit) {
- if( dynamic_cast<Geom::CubicBezier const*>(&*cit) ||
- is_straight_curve(*cit) )
- {
- output.back().append(*cit);
- }
- else {
- // convert all other curve types to cubicbeziers
- Geom::Path cubicbezier_path = Geom::cubicbezierpath_from_sbasis(cit->toSBasis(), 0.1);
- output.back().append(cubicbezier_path);
+ if (is_straight_curve(*cit)) {
+ Geom::LineSegment l(cit->initialPoint(), cit->finalPoint());
+ output.back().append(l);
+ } else {
+ Geom::BezierCurve const *curve = dynamic_cast<Geom::BezierCurve const *>(&*cit);
+ if (curve && curve->order() == 3) {
+ Geom::CubicBezier b((*curve)[0], (*curve)[1], (*curve)[2], (*curve)[3]);
+ output.back().append(b);
+ } else {
+ // convert all other curve types to cubicbeziers
+ Geom::Path cubicbezier_path = Geom::cubicbezierpath_from_sbasis(cit->toSBasis(), 0.1);
+ output.back().append(cubicbezier_path);
+ }
}
}
}