summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3926486)
raw | patch | inline | side by side (parent: 3926486)
author | theadib <theadib@users.sourceforge.net> | |
Fri, 24 Apr 2009 10:37:51 +0000 (10:37 +0000) | ||
committer | theadib <theadib@users.sourceforge.net> | |
Fri, 24 Apr 2009 10:37:51 +0000 (10:37 +0000) |
src/extension/internal/cairo-render-context.cpp | patch | blob | history | |
src/extension/internal/cairo-render-context.h | patch | blob | history | |
src/ui/dialog/print.cpp | patch | blob | history |
diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp
index 656cd4a08956b40d5e4498060e2f6a2cdad5c126..e10b637f369d172b80e1021b5c375a05e55f7366 100644 (file)
}
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;
}
_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 23845598e18ffd53289111ce7cec0320ef0dbf27..930668e03b348b1749c08f1d302ee7f4b17dae22 100644 (file)
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);
unsigned int _showGlyphs(cairo_t *cr, PangoFont *font, std::vector<CairoGlyphInfo> 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);
index bb2b5d68dd886e8cd9cafd31765a859709d1368d..890e0061c7f68c5b8b7bb4b81c5b537c441fcd28 100644 (file)
--- a/src/ui/dialog/print.cpp
+++ b/src/ui/dialog/print.cpp
}
#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);