From: theadib Date: Fri, 24 Apr 2009 10:37:51 +0000 (+0000) Subject: apply printing w32 patch https://bugs.launchpad.net/inkscape/+bug/179988/comments/174 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cfdfe409e3f0e89429aa413061053432385ec994;p=inkscape.git apply printing w32 patch https://bugs.launchpad.net/inkscape/+bug/179988/comments/174 --- diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index 656cd4a08..e10b637f3 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -780,20 +780,20 @@ CairoRenderContext::setupSurface(double width, double height) } bool -CairoRenderContext::setSurfaceTarget(cairo_surface_t *surface, bool is_vector) +CairoRenderContext::setSurfaceTarget(cairo_surface_t *surface, bool is_vector, cairo_matrix_t *ctm) { if (_is_valid || !surface) return false; _vector_based_target = is_vector; - bool ret = _finishSurfaceSetup (surface); + bool ret = _finishSurfaceSetup (surface, ctm); if (ret) cairo_surface_reference (surface); return ret; } bool -CairoRenderContext::_finishSurfaceSetup(cairo_surface_t *surface) +CairoRenderContext::_finishSurfaceSetup(cairo_surface_t *surface, cairo_matrix_t *ctm) { if(surface == NULL) { return FALSE; @@ -803,6 +803,8 @@ CairoRenderContext::_finishSurfaceSetup(cairo_surface_t *surface) } _cr = cairo_create(surface); + if (ctm) + cairo_set_matrix(_cr, ctm); _surface = surface; if (_vector_based_target) { diff --git a/src/extension/internal/cairo-render-context.h b/src/extension/internal/cairo-render-context.h index 23845598e..930668e03 100644 --- a/src/extension/internal/cairo-render-context.h +++ b/src/extension/internal/cairo-render-context.h @@ -85,7 +85,7 @@ public: bool setPdfTarget(gchar const *utf8_fn); bool setPsTarget(gchar const *utf8_fn); /** Set the cairo_surface_t from an external source */ - bool setSurfaceTarget(cairo_surface_t *surface, bool is_vector); + bool setSurfaceTarget(cairo_surface_t *surface, bool is_vector, cairo_matrix_t *ctm=NULL); void setPSLevel(unsigned int level); void setEPS(bool eps); @@ -187,7 +187,7 @@ protected: unsigned int _showGlyphs(cairo_t *cr, PangoFont *font, std::vector const &glyphtext, bool is_stroke); - bool _finishSurfaceSetup(cairo_surface_t *surface); + bool _finishSurfaceSetup(cairo_surface_t *surface, cairo_matrix_t *ctm = NULL); void _setFillStyle(SPStyle const *style, NRRect const *pbox); void _setStrokeStyle(SPStyle const *style, NRRect const *pbox); diff --git a/src/ui/dialog/print.cpp b/src/ui/dialog/print.cpp index bb2b5d68d..890e0061c 100644 --- a/src/ui/dialog/print.cpp +++ b/src/ui/dialog/print.cpp @@ -167,7 +167,10 @@ draw_page (GtkPrintOperation */*operation*/, } #endif - bool ret = ctx->setSurfaceTarget (surface, true); if (ret) { + cairo_matrix_t ctm; + cairo_get_matrix(cr, &ctm); + bool ret = ctx->setSurfaceTarget (surface, true, &ctm); + if (ret) { ret = renderer.setupDocument (ctx, junk->_doc, TRUE, NULL); if (ret) { renderer.renderItem(ctx, junk->_base);