diff options
| author | bulia byak <buliabyak@gmail.com> | 2008-04-07 00:51:24 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2008-04-07 00:51:24 +0000 |
| commit | c9a62859b455a2ea82ff74d25c35b5bdacd98dac (patch) | |
| tree | d1f0bb1be370676a5779c3851a7cc298a0659bc2 /src/display/inkscape-cairo.cpp | |
| parent | consistency with offset keys (diff) | |
| download | inkscape-c9a62859b455a2ea82ff74d25c35b5bdacd98dac.tar.gz inkscape-c9a62859b455a2ea82ff74d25c35b5bdacd98dac.zip | |
fix bug with garbage lines caused with close_path when part of a subpath is optimized out
(bzr r5360)
Diffstat (limited to 'src/display/inkscape-cairo.cpp')
| -rw-r--r-- | src/display/inkscape-cairo.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/display/inkscape-cairo.cpp b/src/display/inkscape-cairo.cpp index 5d87d39b2..d2e2b7d8b 100644 --- a/src/display/inkscape-cairo.cpp +++ b/src/display/inkscape-cairo.cpp @@ -56,17 +56,27 @@ feed_curve_to_cairo (cairo_t *ct, NArtBpath *bpath, NR::Matrix trans, NR::Maybe< view.growBy (stroke_width); NR::Rect swept; bool closed = false; + NR::Point startpath(0,0); for (int i = 0; bpath[i].code != NR_END; i++) { switch (bpath[i].code) { case NR_MOVETO_OPEN: case NR_MOVETO: - if (closed) cairo_close_path(ct); - closed = (bpath[i].code == NR_MOVETO); + if (closed) { + // we cannot use close_path because some of the curves/lines may have been optimized out + cairo_line_to(ct, startpath[NR::X], startpath[NR::Y]); + } next[NR::X] = bpath[i].x3; next[NR::Y] = bpath[i].y3; next *= trans; last = next; next -= shift; + if (bpath[i].code == NR_MOVETO) { + // remember the start point of the subpath, for closing it later + closed = true; + startpath = next; + } else { + closed = false; + } cairo_move_to(ct, next[NR::X], next[NR::Y]); break; |
