diff options
| author | Liam P. White <inkscapebrony@gmail.com> | 2014-08-17 14:46:20 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebrony@gmail.com> | 2014-08-17 14:46:20 +0000 |
| commit | a4c8b296b04ffcb728e75f465872cfd42aef787e (patch) | |
| tree | 139168352b7852adff3237e9323246e0603ff81d /src/ui/dialog/print.cpp | |
| parent | Fix gtk3 build (diff) | |
| parent | Similar workaround to r13523 (text&font dialog not appearing quickly) (diff) | |
| download | inkscape-a4c8b296b04ffcb728e75f465872cfd42aef787e.tar.gz inkscape-a4c8b296b04ffcb728e75f465872cfd42aef787e.zip | |
Update to trunk r13525
(bzr r13341.1.142)
Diffstat (limited to 'src/ui/dialog/print.cpp')
| -rw-r--r-- | src/ui/dialog/print.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/ui/dialog/print.cpp b/src/ui/dialog/print.cpp index 459e64041..ed39ebb32 100644 --- a/src/ui/dialog/print.cpp +++ b/src/ui/dialog/print.cpp @@ -14,8 +14,15 @@ # include <config.h> #endif +#ifdef WIN32 +#include <io.h> +#include <windows.h> +#endif + +#include <gtkmm.h> + +#include "preferences.h" #include "print.h" -#include <gtkmm/stock.h> #include "extension/internal/cairo-render-context.h" #include "extension/internal/cairo-renderer.h" @@ -29,11 +36,6 @@ #include <glibmm/i18n.h> -#ifdef WIN32 -#include <io.h> -#include <windows.h> -#endif - static void draw_page( #ifdef WIN32 @@ -45,14 +47,18 @@ static void draw_page( gint /*page_nr*/, gpointer user_data) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); struct workaround_gtkmm *junk = (struct workaround_gtkmm*)user_data; //printf("%s %d\n",__FUNCTION__, page_nr); if (junk->_tab->as_bitmap()) { // Render as exported PNG + prefs->setBool("/dialogs/printing/asbitmap", true); gdouble width = (junk->_doc)->getWidth().value("px"); gdouble height = (junk->_doc)->getHeight().value("px"); gdouble dpi = junk->_tab->bitmap_dpi(); + prefs->setDouble("/dialogs/printing/dpi", dpi); + std::string tmp_png; std::string tmp_base = "inkscape-print-png-XXXXXX"; @@ -93,7 +99,7 @@ static void draw_page( cairo_get_matrix(cr, &m); cairo_scale(cr, Inkscape::Util::Quantity::convert(1, "in", "pt") / dpi, Inkscape::Util::Quantity::convert(1, "in", "pt") / dpi); // FIXME: why is the origin offset?? - cairo_set_source_surface(cr, png->cobj(), -16.0, -16.0); + cairo_set_source_surface(cr, png->cobj(), 0, 0); cairo_paint(cr); cairo_set_matrix(cr, &m); } @@ -107,6 +113,7 @@ static void draw_page( } else { // Render as vectors + prefs->setBool("/dialogs/printing/asbitmap", false); Inkscape::Extension::Internal::CairoRenderer renderer; Inkscape::Extension::Internal::CairoRenderContext *ctx = renderer.createContext(); |
