Code

don't call cairo_new_path in feed_pathvector_to_cairo (like the old feed_path_to_cair...
authorjohanengelen <johanengelen@users.sourceforge.net>
Tue, 15 Jul 2008 00:00:48 +0000 (00:00 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Tue, 15 Jul 2008 00:00:48 +0000 (00:00 +0000)
src/display/inkscape-cairo.cpp
src/extension/internal/pdf-cairo.cpp

index e41d93952c9e36a47224f66a3b110899fa5cf9cd..907f4c3ef41379730bb19d53016fbb95c82745ff 100644 (file)
@@ -294,7 +294,8 @@ feed_path_to_cairo (cairo_t *ct, Geom::Path const &path, Geom::Matrix trans, NR:
     }
 }
 
-/** Feeds path-creating calls to the cairo context translating them from the PathVector, with the given transform and shift */
+/** Feeds path-creating calls to the cairo context translating them from the PathVector, with the given transform and shift
+ *  One must have done cairo_new_path(ct); before calling this function. */
 void
 feed_pathvector_to_cairo (cairo_t *ct, Geom::PathVector const &pathv, Geom::Matrix trans, NR::Maybe<NR::Rect> area, bool optimize_stroke, double stroke_width)
 {
@@ -303,22 +304,19 @@ feed_pathvector_to_cairo (cairo_t *ct, Geom::PathVector const &pathv, Geom::Matr
     if (pathv.empty())
         return;
 
-    cairo_new_path(ct);
-
     for(Geom::PathVector::const_iterator it = pathv.begin(); it != pathv.end(); ++it) {
         feed_path_to_cairo(ct, *it, trans, area, optimize_stroke, stroke_width);
     }
 }
 
-/** Feeds path-creating calls to the cairo context translating them from the PathVector */
+/** Feeds path-creating calls to the cairo context translating them from the PathVector
+ *  One must have done cairo_new_path(ct); before calling this function. */
 void
 feed_pathvector_to_cairo (cairo_t *ct, Geom::PathVector const &pathv)
 {
     if (pathv.empty())
         return;
 
-    cairo_new_path(ct);
-
     for(Geom::PathVector::const_iterator it = pathv.begin(); it != pathv.end(); ++it) {
         feed_path_to_cairo(ct, *it);
     }
index bd1f2433ce0c5aeb223200c0291af328833be7e4..0ff57127529263254f220ed147f9a21b5bae4535 100644 (file)
@@ -599,6 +599,7 @@ PrintCairoPDF::fill(Inkscape::Extension::Print *mod, Geom::PathVector const &pat
 
         print_fill_style(cr, style, pbox);
 
+        cairo_new_path(cr);
         feed_pathvector_to_cairo(cr, pathv);
 
         if (style->fill_rule.computed == SP_WIND_RULE_EVENODD) {
@@ -697,6 +698,7 @@ PrintCairoPDF::stroke(Inkscape::Extension::Print *mod, Geom::PathVector const &p
 
         cairo_save(cr);
 
+        cairo_new_path(cr);
         print_stroke_style(cr, style, pbox);
 
         feed_pathvector_to_cairo(cr, pathv);