diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-07-12 15:44:30 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-07-12 15:44:30 +0000 |
| commit | 9377f816024bd56159ee1f1760c08098f25ef25f (patch) | |
| tree | be86e5fd686a64317670ae49546cee26382ef61d /src/display | |
| parent | add simplified feed_path_to_cairo functions (diff) | |
| download | inkscape-9377f816024bd56159ee1f1760c08098f25ef25f.tar.gz inkscape-9377f816024bd56159ee1f1760c08098f25ef25f.zip | |
* remove code duplication from pdf-cairo extension
* try to fix line closing bug when using cairo. didn't succeed
(bzr r6276)
Diffstat (limited to 'src/display')
| -rw-r--r-- | src/display/inkscape-cairo.cpp | 10 | ||||
| -rw-r--r-- | src/display/inkscape-cairo.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/display/inkscape-cairo.cpp b/src/display/inkscape-cairo.cpp index 9210af1f4..e41d93952 100644 --- a/src/display/inkscape-cairo.cpp +++ b/src/display/inkscape-cairo.cpp @@ -233,8 +233,8 @@ feed_curve_to_cairo(cairo_t *cr, Geom::Curve const &c, Geom::Matrix const & tran } -/** Feeds path-creating calls to the cairo context translating them from the Path, with the given transform and shift */ -void +/** Feeds path-creating calls to the cairo context translating them from the Path */ +static void feed_path_to_cairo (cairo_t *ct, Geom::Path const &path) { if (path.empty()) @@ -259,7 +259,7 @@ feed_path_to_cairo (cairo_t *ct, Geom::Path const &path) } /** Feeds path-creating calls to the cairo context translating them from the Path, with the given transform and shift */ -void +static void feed_path_to_cairo (cairo_t *ct, Geom::Path const &path, Geom::Matrix trans, NR::Maybe<NR::Rect> area, bool optimize_stroke, double stroke_width) { if (!area || area->isEmpty()) @@ -303,6 +303,8 @@ 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); } @@ -315,6 +317,8 @@ 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); } diff --git a/src/display/inkscape-cairo.h b/src/display/inkscape-cairo.h index 02a145a33..43cafa4bc 100644 --- a/src/display/inkscape-cairo.h +++ b/src/display/inkscape-cairo.h @@ -23,8 +23,6 @@ class SPCanvasBuf; cairo_t *nr_create_cairo_context_canvasbuf (NRRectL *area, SPCanvasBuf *b); cairo_t *nr_create_cairo_context (NRRectL *area, NRPixBlock *pb); void feed_curve_to_cairo (cairo_t *ct, NArtBpath const *bpath, NR::Matrix trans, NR::Maybe<NR::Rect> area, bool optimize_stroke, double stroke_width); -void feed_path_to_cairo (cairo_t *ct, Geom::Path const &path); -void feed_path_to_cairo (cairo_t *ct, Geom::Path const &path, Geom::Matrix trans, NR::Maybe<NR::Rect> area, bool optimize_stroke, double stroke_width); 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); void feed_pathvector_to_cairo (cairo_t *ct, Geom::PathVector const &pathv); |
