From fb749ad5edae38b062e00d1593ec0d306bac4ada Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 5 Feb 2011 03:04:47 +0100 Subject: Fix node tool brokenness resulting from a switch to runtime order in 2Geom's BezierCurve (bzr r10035) --- src/ui/tool/path-manipulator.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/ui/tool/path-manipulator.cpp') diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 47e28a788..0e5705ee4 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -1039,13 +1039,14 @@ void PathManipulator::_createControlPointsFromGeometry() subpath->push_back(current_node); } // if this is a bezier segment, move handles appropriately - if (Geom::CubicBezier const *cubic_bezier = - dynamic_cast(&*cit)) + // TODO: I don't know why the dynamic cast below doesn't want to work + // when I replace BezierCurve with CubicBezier. Might be a bug + // somewhere in pathv_to_linear_and_cubic_beziers + Geom::BezierCurve const *bezier = dynamic_cast(&*cit); + if (bezier && bezier->order() == 3) { - std::vector points = cubic_bezier->points(); - - previous_node->front()->setPosition(points[1]); - current_node ->back() ->setPosition(points[2]); + previous_node->front()->setPosition((*bezier)[1]); + current_node ->back() ->setPosition((*bezier)[2]); } previous_node = current_node; } -- cgit v1.2.3