From 4610b6fd647f02ba014e35a3e83da530194c25d1 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Sat, 12 Jul 2008 15:21:12 +0000 Subject: [PATCH] 2geomify print, fill and stroke methods of extensions --- src/extension/implementation/implementation.cpp | 4 ++-- src/extension/implementation/implementation.h | 5 +++-- src/extension/internal/emf-win32-print.cpp | 16 +++++++++++----- src/extension/internal/emf-win32-print.h | 4 ++-- src/extension/internal/latex-pstricks.cpp | 16 ++++++++++------ src/extension/internal/latex-pstricks.h | 4 ++-- src/extension/internal/pdf-cairo.cpp | 13 +++++++++---- src/extension/internal/pdf-cairo.h | 4 ++-- src/extension/internal/ps.cpp | 13 +++++++++---- src/extension/internal/ps.h | 4 ++-- src/extension/print.cpp | 8 ++++---- src/extension/print.h | 4 ++-- src/libnrtype/Layout-TNG-Output.cpp | 14 +++++--------- src/print.cpp | 8 ++++---- src/print.h | 5 +++-- src/sp-shape.cpp | 8 ++------ 16 files changed, 72 insertions(+), 58 deletions(-) diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp index 83b865cdb..0f2580eb9 100644 --- a/src/extension/implementation/implementation.cpp +++ b/src/extension/implementation/implementation.cpp @@ -166,14 +166,14 @@ Implementation::comment(Inkscape::Extension::Print */*module*/, char const */*co } unsigned int -Implementation::fill(Inkscape::Extension::Print */*module*/, const_NRBPath const */*bpath*/, NR::Matrix const */*ctm*/, SPStyle const */*style*/, +Implementation::fill(Inkscape::Extension::Print */*module*/, Geom::PathVector const &/*pathv*/, NR::Matrix const */*ctm*/, SPStyle const */*style*/, NRRect const */*pbox*/, NRRect const */*dbox*/, NRRect const */*bbox*/) { return 0; } unsigned int -Implementation::stroke(Inkscape::Extension::Print */*module*/, const_NRBPath const */*bpath*/, NR::Matrix const */*transform*/, SPStyle const */*style*/, +Implementation::stroke(Inkscape::Extension::Print */*module*/, Geom::PathVector const &/*pathv*/, NR::Matrix const */*transform*/, SPStyle const */*style*/, NRRect const */*pbox*/, NRRect const */*dbox*/, NRRect const */*bbox*/) { return 0; diff --git a/src/extension/implementation/implementation.h b/src/extension/implementation/implementation.h index 29366ddf5..d90d2e7a9 100644 --- a/src/extension/implementation/implementation.h +++ b/src/extension/implementation/implementation.h @@ -21,6 +21,7 @@ #include "libnr/nr-forward.h" #include "libnr/nr-point.h" #include "xml/node.h" +#include <2geom/forward.h> namespace Inkscape { namespace Extension { @@ -104,14 +105,14 @@ public: virtual unsigned release(Inkscape::Extension::Print *module); virtual unsigned comment(Inkscape::Extension::Print *module, const char * comment); virtual unsigned fill(Inkscape::Extension::Print *module, - const_NRBPath const *bpath, + Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *style, NRRect const *pbox, NRRect const *dbox, NRRect const *bbox); virtual unsigned stroke(Inkscape::Extension::Print *module, - const_NRBPath const *bpath, + Geom::PathVector const &pathv, NR::Matrix const *transform, SPStyle const *style, NRRect const *pbox, diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp index 0e231a608..e696df06d 100644 --- a/src/extension/internal/emf-win32-print.cpp +++ b/src/extension/internal/emf-win32-print.cpp @@ -43,6 +43,7 @@ #include "libnr/nr-matrix-fns.h" #include "libnr/nr-path.h" #include "libnr/nr-pixblock.h" +#include #include "display/canvas-bpath.h" #include "sp-item.h" @@ -501,7 +502,7 @@ PrintEmfWin32::release(Inkscape::Extension::Print *mod) unsigned int PrintEmfWin32::fill(Inkscape::Extension::Print *mod, - const_NRBPath const *bpath, NR::Matrix const *transform, SPStyle const *style, + Geom::PathVector const &pathv, NR::Matrix const *transform, SPStyle const *style, NRRect const *pbox, NRRect const *dbox, NRRect const *bbox) { if (!hdc) return 0; @@ -518,7 +519,9 @@ PrintEmfWin32::fill(Inkscape::Extension::Print *mod, return 0; } - fill_path = copy_bpath( bpath->path ); + NArtBpath * bpath = BPath_from_2GeomPath(pathv); + fill_path = copy_bpath( bpath ); + g_free(bpath); fill_transform = tf; fill_pbox = *pbox; @@ -530,14 +533,16 @@ PrintEmfWin32::fill(Inkscape::Extension::Print *mod, unsigned int PrintEmfWin32::stroke (Inkscape::Extension::Print *mod, - const const_NRBPath *bpath, const NR::Matrix *transform, const SPStyle *style, + Geom::PathVector const &pathv, const NR::Matrix *transform, const SPStyle *style, const NRRect *pbox, const NRRect *dbox, const NRRect *bbox) { if (!hdc) return 0; NR::Matrix tf = m_tr_stack.top(); - stroke_and_fill = ( cmp_bpath( bpath->path, fill_path ) == 0 ); + NArtBpath * bpath = BPath_from_2GeomPath(pathv); + + stroke_and_fill = ( cmp_bpath( bpath, fill_path ) == 0 ); if (!stroke_and_fill) { flush_fill(); // flush any pending fills @@ -550,7 +555,7 @@ PrintEmfWin32::stroke (Inkscape::Extension::Print *mod, return 0; } - print_bpath(bpath->path, &tf, pbox); + print_bpath(bpath, &tf, pbox); if (stroke_and_fill) { if (!simple_shape) @@ -563,6 +568,7 @@ PrintEmfWin32::stroke (Inkscape::Extension::Print *mod, StrokePath( hdc ); } + g_free(bpath); destroy_pen(); return 0; diff --git a/src/extension/internal/emf-win32-print.h b/src/extension/internal/emf-win32-print.h index b885efbe1..11b265dcc 100644 --- a/src/extension/internal/emf-win32-print.h +++ b/src/extension/internal/emf-win32-print.h @@ -71,10 +71,10 @@ public: virtual unsigned int bind(Inkscape::Extension::Print *module, NR::Matrix const *transform, float opacity); virtual unsigned int release(Inkscape::Extension::Print *module); virtual unsigned int fill (Inkscape::Extension::Print * module, - const const_NRBPath *bpath, const NR::Matrix *ctm, const SPStyle *style, + Geom::PathVector const &pathv, const NR::Matrix *ctm, const SPStyle *style, const NRRect *pbox, const NRRect *dbox, const NRRect *bbox); virtual unsigned int stroke (Inkscape::Extension::Print * module, - const const_NRBPath *bpath, const NR::Matrix *transform, const SPStyle *style, + Geom::PathVector const &pathv, const NR::Matrix *transform, const SPStyle *style, const NRRect *pbox, const NRRect *dbox, const NRRect *bbox); virtual unsigned int comment(Inkscape::Extension::Print *module, const char * comment); virtual unsigned int text(Inkscape::Extension::Print *module, char const *text, diff --git a/src/extension/internal/latex-pstricks.cpp b/src/extension/internal/latex-pstricks.cpp index 1496b75f6..1ef5c57ab 100644 --- a/src/extension/internal/latex-pstricks.cpp +++ b/src/extension/internal/latex-pstricks.cpp @@ -27,7 +27,7 @@ #include "libnr/nr-scale-translate-ops.h" #include "libnr/nr-translate-scale-ops.h" #include - +#include #include "libnr/n-art-bpath.h" #include "sp-item.h" @@ -201,8 +201,8 @@ unsigned int PrintLatex::comment (Inkscape::Extension::Print * module, unsigned int PrintLatex::fill(Inkscape::Extension::Print *mod, - const_NRBPath const *bpath, NR::Matrix const *transform, SPStyle const *style, - NRRect const *pbox, NRRect const *dbox, NRRect const *bbox) + Geom::PathVector const &pathv, NR::Matrix const *transform, SPStyle const *style, + NRRect const *pbox, NRRect const *dbox, NRRect const *bbox) { if (!_stream) return 0; // XXX: fixme, returning -1 as unsigned. @@ -217,7 +217,9 @@ PrintLatex::fill(Inkscape::Extension::Print *mod, os << "\\pscustom[linestyle=none,fillstyle=solid,fillcolor=curcolor]\n{\n"; - print_bpath(os, bpath->path, transform); + NArtBpath * bpath = BPath_from_2GeomPath(pathv); + print_bpath(os, bpath, transform); + g_free(bpath); os << "}\n}\n"; @@ -228,7 +230,7 @@ PrintLatex::fill(Inkscape::Extension::Print *mod, } unsigned int -PrintLatex::stroke (Inkscape::Extension::Print *mod, const const_NRBPath *bpath, const NR::Matrix *transform, const SPStyle *style, +PrintLatex::stroke (Inkscape::Extension::Print *mod, Geom::PathVector const &pathv, const NR::Matrix *transform, const SPStyle *style, const NRRect *pbox, const NRRect *dbox, const NRRect *bbox) { if (!_stream) return 0; // XXX: fixme, returning -1 as unsigned. @@ -260,7 +262,9 @@ PrintLatex::stroke (Inkscape::Extension::Print *mod, const const_NRBPath *bpath, os <<"]\n{\n"; - print_bpath(os, bpath->path, transform); + NArtBpath * bpath = BPath_from_2GeomPath(pathv); + print_bpath(os, bpath, transform); + g_free(bpath); os << "}\n}\n"; diff --git a/src/extension/internal/latex-pstricks.h b/src/extension/internal/latex-pstricks.h index 56600023a..d70afc54e 100644 --- a/src/extension/internal/latex-pstricks.h +++ b/src/extension/internal/latex-pstricks.h @@ -49,9 +49,9 @@ public: virtual unsigned int bind(Inkscape::Extension::Print *module, NR::Matrix const *transform, float opacity); virtual unsigned int release(Inkscape::Extension::Print *module); - virtual unsigned int fill (Inkscape::Extension::Print * module, const const_NRBPath *bpath, const NR::Matrix *ctm, const SPStyle *style, + virtual unsigned int fill (Inkscape::Extension::Print * module, Geom::PathVector const &pathv, const NR::Matrix *ctm, const SPStyle *style, const NRRect *pbox, const NRRect *dbox, const NRRect *bbox); - virtual unsigned int stroke (Inkscape::Extension::Print * module, const const_NRBPath *bpath, const NR::Matrix *transform, const SPStyle *style, + virtual unsigned int stroke (Inkscape::Extension::Print * module, Geom::PathVector const &pathv, const NR::Matrix *transform, const SPStyle *style, const NRRect *pbox, const NRRect *dbox, const NRRect *bbox); virtual unsigned int comment(Inkscape::Extension::Print *module, const char * comment); bool textToPath (Inkscape::Extension::Print * ext); diff --git a/src/extension/internal/pdf-cairo.cpp b/src/extension/internal/pdf-cairo.cpp index dd6956a1e..6dfed9e82 100644 --- a/src/extension/internal/pdf-cairo.cpp +++ b/src/extension/internal/pdf-cairo.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -584,7 +585,7 @@ PrintCairoPDF::print_fill_style(cairo_t *cr, SPStyle const *const style, NRRect } unsigned int -PrintCairoPDF::fill(Inkscape::Extension::Print *mod, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *const style, +PrintCairoPDF::fill(Inkscape::Extension::Print *mod, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *const style, NRRect const *pbox, NRRect const *dbox, NRRect const *bbox) { if (!_stream) return 0; // XXX: fixme, returning -1 as unsigned. @@ -599,7 +600,9 @@ PrintCairoPDF::fill(Inkscape::Extension::Print *mod, const_NRBPath const *bpath, cairo_save(cr); print_fill_style(cr, style, pbox); - print_bpath(cr, bpath->path); + NArtBpath * bpath = BPath_from_2GeomPath(pathv); + print_bpath(cr, bpath); + g_free(bpath); if (style->fill_rule.computed == SP_WIND_RULE_EVENODD) { cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD); } else { @@ -684,7 +687,7 @@ PrintCairoPDF::print_stroke_style(cairo_t *cr, SPStyle const *style, NRRect cons } unsigned int -PrintCairoPDF::stroke(Inkscape::Extension::Print *mod, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *style, +PrintCairoPDF::stroke(Inkscape::Extension::Print *mod, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *style, NRRect const *pbox, NRRect const *dbox, NRRect const *bbox) { if (!_stream) return 0; // XXX: fixme, returning -1 as unsigned. @@ -697,7 +700,9 @@ PrintCairoPDF::stroke(Inkscape::Extension::Print *mod, const_NRBPath const *bpat cairo_save(cr); print_stroke_style(cr, style, pbox); - print_bpath(cr, bpath->path); + NArtBpath * bpath = BPath_from_2GeomPath(pathv); + print_bpath(cr, bpath); + g_free(bpath); cairo_stroke(cr); cairo_restore(cr); diff --git a/src/extension/internal/pdf-cairo.h b/src/extension/internal/pdf-cairo.h index b37cfe22d..8e2764fa4 100644 --- a/src/extension/internal/pdf-cairo.h +++ b/src/extension/internal/pdf-cairo.h @@ -78,9 +78,9 @@ public: virtual unsigned int bind(Inkscape::Extension::Print *module, NR::Matrix const *transform, float opacity); virtual unsigned int release(Inkscape::Extension::Print *module); virtual unsigned int comment(Inkscape::Extension::Print *module, char const *comment); - virtual unsigned int fill(Inkscape::Extension::Print *module, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *style, + virtual unsigned int fill(Inkscape::Extension::Print *module, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *style, NRRect const *pbox, NRRect const *dbox, NRRect const *bbox); - virtual unsigned int stroke(Inkscape::Extension::Print *module, const_NRBPath const *bpath, NR::Matrix const *transform, SPStyle const *style, + virtual unsigned int stroke(Inkscape::Extension::Print *module, Geom::PathVector const &pathv, NR::Matrix const *transform, SPStyle const *style, NRRect const *pbox, NRRect const *dbox, NRRect const *bbox); virtual unsigned int image(Inkscape::Extension::Print *module, unsigned char *px, unsigned int w, unsigned int h, unsigned int rs, NR::Matrix const *transform, SPStyle const *style); diff --git a/src/extension/internal/ps.cpp b/src/extension/internal/ps.cpp index 299157555..7670c3a86 100644 --- a/src/extension/internal/ps.cpp +++ b/src/extension/internal/ps.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -813,7 +814,7 @@ PrintPS::print_stroke_style(SVGOStringStream &os, SPStyle const *style) unsigned int -PrintPS::fill(Inkscape::Extension::Print *mod, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *const style, +PrintPS::fill(Inkscape::Extension::Print *mod, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *const style, NRRect const *pbox, NRRect const *dbox, NRRect const *bbox) { if (!_stream) return 0; // XXX: fixme, returning -1 as unsigned. @@ -829,7 +830,9 @@ PrintPS::fill(Inkscape::Extension::Print *mod, const_NRBPath const *bpath, NR::M print_fill_style(os, style, pbox); - print_bpath(os, bpath->path); + NArtBpath * bpath = BPath_from_2GeomPath(pathv); + print_bpath(os, bpath); + g_free(bpath); if (style->fill_rule.computed == SP_WIND_RULE_EVENODD) { if (style->fill.isColor()) { @@ -879,7 +882,7 @@ PrintPS::fill(Inkscape::Extension::Print *mod, const_NRBPath const *bpath, NR::M unsigned int -PrintPS::stroke(Inkscape::Extension::Print *mod, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *style, +PrintPS::stroke(Inkscape::Extension::Print *mod, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *style, NRRect const *pbox, NRRect const *dbox, NRRect const *bbox) { if (!_stream) return 0; // XXX: fixme, returning -1 as unsigned. @@ -890,7 +893,9 @@ PrintPS::stroke(Inkscape::Extension::Print *mod, const_NRBPath const *bpath, NR: print_stroke_style(os, style); - print_bpath(os, bpath->path); + NArtBpath * bpath = BPath_from_2GeomPath(pathv); + print_bpath(os, bpath); + g_free(bpath); os << "stroke\n"; diff --git a/src/extension/internal/ps.h b/src/extension/internal/ps.h index edeaaeac6..407da88a3 100644 --- a/src/extension/internal/ps.h +++ b/src/extension/internal/ps.h @@ -91,9 +91,9 @@ public: virtual unsigned int bind(Inkscape::Extension::Print *module, NR::Matrix const *transform, float opacity); virtual unsigned int release(Inkscape::Extension::Print *module); virtual unsigned int comment(Inkscape::Extension::Print *module, char const *comment); - virtual unsigned int fill(Inkscape::Extension::Print *module, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *style, + virtual unsigned int fill(Inkscape::Extension::Print *module, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *style, NRRect const *pbox, NRRect const *dbox, NRRect const *bbox); - virtual unsigned int stroke(Inkscape::Extension::Print *module, const_NRBPath const *bpath, NR::Matrix const *transform, SPStyle const *style, + virtual unsigned int stroke(Inkscape::Extension::Print *module, Geom::PathVector const &pathv, NR::Matrix const *transform, SPStyle const *style, NRRect const *pbox, NRRect const *dbox, NRRect const *bbox); virtual unsigned int image(Inkscape::Extension::Print *module, unsigned char *px, unsigned int w, unsigned int h, unsigned int rs, NR::Matrix const *transform, SPStyle const *style); diff --git a/src/extension/print.cpp b/src/extension/print.cpp index eded694a5..035865825 100644 --- a/src/extension/print.cpp +++ b/src/extension/print.cpp @@ -79,17 +79,17 @@ Print::comment (const char * comment) } unsigned int -Print::fill (const const_NRBPath *bpath, const NR::Matrix *ctm, const SPStyle *style, +Print::fill (Geom::PathVector const &pathv, const NR::Matrix *ctm, const SPStyle *style, const NRRect *pbox, const NRRect *dbox, const NRRect *bbox) { - return imp->fill (this, bpath, ctm, style, pbox, dbox, bbox); + return imp->fill (this, pathv, ctm, style, pbox, dbox, bbox); } unsigned int -Print::stroke (const const_NRBPath *bpath, const NR::Matrix *transform, const SPStyle *style, +Print::stroke (Geom::PathVector const &pathv, const NR::Matrix *transform, const SPStyle *style, const NRRect *pbox, const NRRect *dbox, const NRRect *bbox) { - return imp->stroke (this, bpath, transform, style, pbox, dbox, bbox); + return imp->stroke (this, pathv, transform, style, pbox, dbox, bbox); } unsigned int diff --git a/src/extension/print.h b/src/extension/print.h index e9796bb2d..c5f49dd9d 100644 --- a/src/extension/print.h +++ b/src/extension/print.h @@ -45,13 +45,13 @@ public: float opacity); unsigned int release (void); unsigned int comment (const char * comment); - unsigned int fill (const_NRBPath const *bpath, + unsigned int fill (Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *style, NRRect const *pbox, NRRect const *dbox, NRRect const *bbox); - unsigned int stroke (const_NRBPath const *bpath, + unsigned int stroke (Geom::PathVector const &pathv, NR::Matrix const *transform, SPStyle const *style, NRRect const *pbox, diff --git a/src/libnrtype/Layout-TNG-Output.cpp b/src/libnrtype/Layout-TNG-Output.cpp index eb6514b34..3ad979cca 100644 --- a/src/libnrtype/Layout-TNG-Output.cpp +++ b/src/libnrtype/Layout-TNG-Output.cpp @@ -155,18 +155,14 @@ void Layout::print(SPPrintContext *ctx, Span const &span = _spans[_characters[_glyphs[glyph_index].in_character].in_span]; InputStreamTextSource const *text_source = static_cast(_input_stream[span.in_input_stream_item]); if (text_to_path || _path_fitted) { - NRBPath bpath; - bpath.path = (NArtBpath*)span.font->ArtBPath(_glyphs[glyph_index].glyph); - if (bpath.path) { - const_NRBPath abp; + Geom::PathVector const * pv = span.font->PathVector(_glyphs[glyph_index].glyph); + if (pv) { _getGlyphTransformMatrix(glyph_index, &glyph_matrix); - NArtBpath *temp_bpath = nr_artpath_affine(bpath.path, glyph_matrix); - abp.path = temp_bpath; + Geom::PathVector temp_pv = (*pv) * to_2geom(glyph_matrix); if (!text_source->style->fill.isNone()) - sp_print_fill(ctx, &abp, &ctm, text_source->style, pbox, dbox, bbox); + sp_print_fill(ctx, temp_pv, &ctm, text_source->style, pbox, dbox, bbox); if (!text_source->style->stroke.isNone()) - sp_print_stroke(ctx, &abp, &ctm, text_source->style, pbox, dbox, bbox); - g_free(temp_bpath); + sp_print_stroke(ctx, temp_pv, &ctm, text_source->style, pbox, dbox, bbox); } glyph_index++; } else { diff --git a/src/print.cpp b/src/print.cpp index b1fc6b3b2..6d4572031 100644 --- a/src/print.cpp +++ b/src/print.cpp @@ -52,17 +52,17 @@ sp_print_comment(SPPrintContext *ctx, char const *comment) } unsigned int -sp_print_fill(SPPrintContext *ctx, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *style, +sp_print_fill(SPPrintContext *ctx, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *style, NRRect const *pbox, NRRect const *dbox, NRRect const *bbox) { - return ctx->module->fill(bpath, ctm, style, pbox, dbox, bbox); + return ctx->module->fill(pathv, ctm, style, pbox, dbox, bbox); } unsigned int -sp_print_stroke(SPPrintContext *ctx, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *style, +sp_print_stroke(SPPrintContext *ctx, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *style, NRRect const *pbox, NRRect const *dbox, NRRect const *bbox) { - return ctx->module->stroke(bpath, ctm, style, pbox, dbox, bbox); + return ctx->module->stroke(pathv, ctm, style, pbox, dbox, bbox); } unsigned int diff --git a/src/print.h b/src/print.h index ce30b8418..ed56c9663 100644 --- a/src/print.h +++ b/src/print.h @@ -13,6 +13,7 @@ #include #include +#include <2geom/forward.h> #include "forward.h" #include "extension/extension-forward.h" @@ -24,9 +25,9 @@ unsigned int sp_print_bind(SPPrintContext *ctx, NR::Matrix const &transform, flo unsigned int sp_print_bind(SPPrintContext *ctx, NR::Matrix const *transform, float opacity); unsigned int sp_print_release(SPPrintContext *ctx); unsigned int sp_print_comment(SPPrintContext *ctx, char const *comment); -unsigned int sp_print_fill(SPPrintContext *ctx, const_NRBPath const *bpath, NR::Matrix const *ctm, SPStyle const *style, +unsigned int sp_print_fill(SPPrintContext *ctx, Geom::PathVector const &pathv, NR::Matrix const *ctm, SPStyle const *style, NRRect const *pbox, NRRect const *dbox, NRRect const *bbox); -unsigned int sp_print_stroke(SPPrintContext *ctx, const_NRBPath const *bpath, NR::Matrix const *transform, SPStyle const *style, +unsigned int sp_print_stroke(SPPrintContext *ctx, Geom::PathVector const &pathv, NR::Matrix const *transform, SPStyle const *style, NRRect const *pbox, NRRect const *dbox, NRRect const *bbox); unsigned int sp_print_image_R8G8B8A8_N(SPPrintContext *ctx, diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp index 9a0ee1fd7..91d7dd5f8 100644 --- a/src/sp-shape.cpp +++ b/src/sp-shape.cpp @@ -613,15 +613,11 @@ sp_shape_print (SPItem *item, SPPrintContext *ctx) SPStyle* style = SP_OBJECT_STYLE (item); if (!style->fill.isNone()) { - const_NRBPath bp; - bp.path = shape->curve->get_bpath(); - sp_print_fill (ctx, &bp, &i2d, style, &pbox, &dbox, &bbox); + sp_print_fill (ctx, shape->curve->get_pathvector(), &i2d, style, &pbox, &dbox, &bbox); } if (!style->stroke.isNone()) { - const_NRBPath bp; - bp.path = shape->curve->get_bpath(); - sp_print_stroke (ctx, &bp, &i2d, style, &pbox, &dbox, &bbox); + sp_print_stroke (ctx, shape->curve->get_pathvector(), &i2d, style, &pbox, &dbox, &bbox); } /* TODO: make code prettier: lots of variables can be taken out of the loop! */ -- 2.30.2