diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-06-29 11:41:26 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-06-29 11:41:26 +0000 |
| commit | 945e4453041f48c83ce26cf29ca7e42e0ce4c4a9 (patch) | |
| tree | bc73ea37dd7f552a4fb69ffab71818533139d14e /src/display/inkscape-cairo.cpp | |
| parent | add commented HLineSegment and VLineSegment to svg writer (diff) | |
| download | inkscape-945e4453041f48c83ce26cf29ca7e42e0ce4c4a9.tar.gz inkscape-945e4453041f48c83ce26cf29ca7e42e0ce4c4a9.zip | |
recognize HLineSegment and VLineSegment in feeding paths to cairo
(bzr r6086)
Diffstat (limited to 'src/display/inkscape-cairo.cpp')
| -rw-r--r-- | src/display/inkscape-cairo.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/display/inkscape-cairo.cpp b/src/display/inkscape-cairo.cpp index 49d47ec77..69e766ce8 100644 --- a/src/display/inkscape-cairo.cpp +++ b/src/display/inkscape-cairo.cpp @@ -159,13 +159,15 @@ feed_curve_to_cairo (cairo_t *ct, NArtBpath const *bpath, NR::Matrix trans, NR:: static void feed_curve_to_cairo(cairo_t *cr, Geom::Curve const &c, Geom::Matrix & trans, Geom::Rect view, bool optimize_stroke) { - if(Geom::LineSegment const* line_segment = dynamic_cast<Geom::LineSegment const*>(&c)) { - // same logic can be used for hlinesegment and vlinesegment: just use finalpoint - Geom::Point end_tr = (*line_segment)[1] * trans; + if( typeid(c) == typeid(Geom::LineSegment) || + typeid(c) == typeid(Geom::HLineSegment) || + typeid(c) == typeid(Geom::VLineSegment) ) + { + Geom::Point end_tr = c.finalPoint() * trans; if (!optimize_stroke) { cairo_line_to(cr, end_tr[0], end_tr[1]); } else { - Geom::Rect swept((*line_segment)[0]*trans, end_tr); + Geom::Rect swept(c.initialPoint()*trans, end_tr); if (swept.intersects(view)) { cairo_line_to(cr, end_tr[0], end_tr[1]); } else { |
