Code

2geomify more of pencil-context.cpp
authorjohanengelen <johanengelen@users.sourceforge.net>
Mon, 7 Jul 2008 15:45:42 +0000 (15:45 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Mon, 7 Jul 2008 15:45:42 +0000 (15:45 +0000)
src/pencil-context.cpp

index 918990e7eadc4a32503a6370e6783dbdd999a95c..5b06770e4a126cffdab85c1f204b8605b9e2d637 100644 (file)
@@ -634,12 +634,11 @@ fit_and_split(SPPencilContext *pc)
 
         /* Set up direction of next curve. */
         {
-            NArtBpath const &last_seg = *pc->red_curve->last_bpath();
-            pc->p[0] = last_seg.c(3);
+            Geom::CubicBezier const * last_seg = dynamic_cast<Geom::CubicBezier const *>(pc->red_curve->last_segment());
+            g_assert( last_seg );      // Relevance: validity of (*last_seg)[2]
+            pc->p[0] = last_seg->finalPoint();
             pc->npoints = 1;
-            g_assert( last_seg.code == NR_CURVETO );
-            /* Relevance: validity of last_seg.c(2). */
-            NR::Point const req_vec( pc->p[0] - last_seg.c(2) );
+            NR::Point const req_vec( pc->p[0] - (*last_seg)[2] );
             pc->req_tangent = ( ( NR::is_zero(req_vec) || !in_svg_plane(req_vec) )
                                 ? NR::Point(0, 0)
                                 : NR::unit_vector(req_vec) );