summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 14a56b8)
raw | patch | inline | side by side (parent: 14a56b8)
author | kiirala <kiirala@users.sourceforge.net> | |
Mon, 22 Sep 2008 14:07:36 +0000 (14:07 +0000) | ||
committer | kiirala <kiirala@users.sourceforge.net> | |
Mon, 22 Sep 2008 14:07:36 +0000 (14:07 +0000) |
src/ui/dialog/print.cpp | patch | blob | history |
index 474b57306f17266e279addb587f973f0076a2063..9e848bd6a4268960733b24a3a63f7a2358dfa195 100644 (file)
--- a/src/ui/dialog/print.cpp
+++ b/src/ui/dialog/print.cpp
sp_export_png_file(junk->_doc, tmp_png.c_str(), 0.0, 0.0,
width, height,
- (unsigned long)(width * PT_PER_IN / PX_PER_IN),
- (unsigned long)(height * PT_PER_IN / PX_PER_IN),
+ (unsigned long)(width * dpi / PX_PER_IN),
+ (unsigned long)(height * dpi / PX_PER_IN),
dpi, dpi, bgcolor, NULL, NULL, true, NULL);
// This doesn't seem to work:
{
Cairo::RefPtr<Cairo::ImageSurface> png = Cairo::ImageSurface::create_from_png (tmp_png);
cairo_t *cr = gtk_print_context_get_cairo_context (context);
+ cairo_matrix_t m;
+ cairo_get_matrix(cr, &m);
+ cairo_scale(cr, PT_PER_IN / dpi, PT_PER_IN / dpi);
// FIXME: why is the origin offset??
cairo_set_source_surface(cr, png->cobj(), -16.0, -16.0);
+ cairo_paint(cr);
+ cairo_set_matrix(cr, &m);
}
- cairo_paint(gtk_print_context_get_cairo_context (context));
// Clean up
unlink (tmp_png.c_str());