summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a3b813b)
raw | patch | inline | side by side (parent: a3b813b)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Mon, 7 Jul 2008 15:45:42 +0000 (15:45 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Mon, 7 Jul 2008 15:45:42 +0000 (15:45 +0000) |
src/pencil-context.cpp | patch | blob | history |
diff --git a/src/pencil-context.cpp b/src/pencil-context.cpp
index 918990e7eadc4a32503a6370e6783dbdd999a95c..5b06770e4a126cffdab85c1f204b8605b9e2d637 100644 (file)
--- a/src/pencil-context.cpp
+++ b/src/pencil-context.cpp
/* 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) );