summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2011-02-12 22:43:10 +0000
committerJohan Engelen <goejendaagh@zonnet.nl>2011-02-12 22:43:10 +0000
commit940bebdae2081d4455e26f2edfd0d8e9adb76542 (patch)
tree5c52fc9f092f204deeec00f041b9fe09d1118728 /src
parentTranslations. Update Indonesian translations. (diff)
downloadinkscape-940bebdae2081d4455e26f2edfd0d8e9adb76542.tar.gz
inkscape-940bebdae2081d4455e26f2edfd0d8e9adb76542.zip
calligraphy tool does not need to know the type of the end curves to add the cap.
(bzr r10049)
Diffstat (limited to 'src')
-rw-r--r--src/dyna-draw-context.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp
index 6f0898d43..2988aea49 100644
--- a/src/dyna-draw-context.cpp
+++ b/src/dyna-draw-context.cpp
@@ -1086,32 +1086,20 @@ accumulate_calligraphic(SPDynaDrawContext *dc)
return false; // failure
}
- 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() );
-
- if (
- !dc_cal1_firstseg ||
- !rev_cal2_firstseg ||
- !dc_cal1_lastseg ||
- !rev_cal2_lastseg
- ) {
- rev_cal2->unref();
- dc->cal1->reset();
- dc->cal2->reset();
- return false; // failure
- }
+ Geom::Curve const * dc_cal1_firstseg = dc->cal1->first_segment();
+ Geom::Curve const * rev_cal2_firstseg = rev_cal2->first_segment();
+ Geom::Curve const * dc_cal1_lastseg = dc->cal1->last_segment();
+ Geom::Curve const * rev_cal2_lastseg = rev_cal2->last_segment();
dc->accumulated->reset(); /* Is this required ?? */
dc->accumulated->append(dc->cal1, false);
- add_cap(dc->accumulated, (*dc_cal1_lastseg)[3], (*rev_cal2_firstseg)[0], dc->cap_rounding);
+ add_cap(dc->accumulated, dc_cal1_lastseg->finalPoint(), rev_cal2_firstseg->initialPoint(), dc->cap_rounding);
dc->accumulated->append(rev_cal2, true);
- add_cap(dc->accumulated, (*rev_cal2_lastseg)[3], (*dc_cal1_firstseg)[0], dc->cap_rounding);
+ add_cap(dc->accumulated, rev_cal2_lastseg->finalPoint(), dc_cal1_firstseg->initialPoint(), dc->cap_rounding);
dc->accumulated->closepath();