diff options
Diffstat (limited to 'src/dyna-draw-context.cpp')
| -rw-r--r-- | src/dyna-draw-context.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp index 1300cf51f..68bb2f163 100644 --- a/src/dyna-draw-context.cpp +++ b/src/dyna-draw-context.cpp @@ -1038,22 +1038,27 @@ accumulate_calligraphic(SPDynaDrawContext *dc) dc->accumulated->reset(); /* Is this required ?? */ SPCurve *rev_cal2 = dc->cal2->create_reverse(); - g_assert(dc->cal1->get_length() > 1); - g_assert(rev_cal2->get_length() > 1); - g_assert(SP_CURVE_SEGMENT(dc->cal1, 0)->code == NR_MOVETO_OPEN); - g_assert(SP_CURVE_SEGMENT(rev_cal2, 0)->code == NR_MOVETO_OPEN); - g_assert(SP_CURVE_SEGMENT(dc->cal1, 1)->code == NR_CURVETO); - g_assert(SP_CURVE_SEGMENT(rev_cal2, 1)->code == NR_CURVETO); - g_assert(SP_CURVE_SEGMENT(dc->cal1, dc->cal1->get_length()-1)->code == NR_CURVETO); - g_assert(SP_CURVE_SEGMENT(rev_cal2, rev_cal2->get_length()-1)->code == NR_CURVETO); + g_assert(dc->cal1->get_segment_count() > 0); + g_assert(rev_cal2->get_segment_count() > 0); + g_assert( ! dc->cal1->first_path()->closed() ); + g_assert( ! rev_cal2->first_path()->closed() ); - dc->accumulated->append(dc->cal1, FALSE); + Geom::CubicBezier const * dc_cal1_firstseg = dynamic_cast<Geom::CubicBezier const *>( dc->cal1->first_segment() ); + Geom::CubicBezier const * rev_cal2_firstseg = dynamic_cast<Geom::CubicBezier const *>( rev_cal2->first_segment() ); + Geom::CubicBezier const * dc_cal1_lastseg = dynamic_cast<Geom::CubicBezier const *>( dc->cal1->last_segment() ); + Geom::CubicBezier const * rev_cal2_lastseg = dynamic_cast<Geom::CubicBezier const *>( rev_cal2->last_segment() ); + g_assert( dc_cal1_firstseg ); + g_assert( rev_cal2_firstseg ); + g_assert( dc_cal1_lastseg ); + g_assert( rev_cal2_lastseg ); - add_cap(dc->accumulated, SP_CURVE_SEGMENT(dc->cal1, dc->cal1->get_length()-1)->c(3), SP_CURVE_SEGMENT(rev_cal2, 0)->c(3), dc->cap_rounding); + dc->accumulated->append(dc->cal1, false); - dc->accumulated->append(rev_cal2, TRUE); + add_cap(dc->accumulated, (*dc_cal1_lastseg)[3], (*rev_cal2_firstseg)[3], dc->cap_rounding); - add_cap(dc->accumulated, SP_CURVE_SEGMENT(rev_cal2, rev_cal2->get_length()-1)->c(3), SP_CURVE_SEGMENT(dc->cal1, 0)->c(3), dc->cap_rounding); + dc->accumulated->append(rev_cal2, true); + + add_cap(dc->accumulated, (*rev_cal2_lastseg)[3], (*dc_cal1_firstseg)[3], dc->cap_rounding); dc->accumulated->closepath(); |
