diff options
| author | Nicolas Dufour <nicoduf@yahoo.fr> | 2014-08-13 06:24:04 +0000 |
|---|---|---|
| committer | JazzyNico <nicoduf@yahoo.fr> | 2014-08-13 06:24:04 +0000 |
| commit | c73ebf3c732e19f665de2d490a915eabf425905e (patch) | |
| tree | 17390c874e883e9c34ccaafcc89fb0b198eb8bb9 /src/ui/dialog/print.cpp | |
| parent | Palettes. Fix for Bug #1248174 (Update the Ubuntu colour palette to fit the s... (diff) | |
| download | inkscape-c73ebf3c732e19f665de2d490a915eabf425905e.tar.gz inkscape-c73ebf3c732e19f665de2d490a915eabf425905e.zip | |
Printing. Fix for Bug #264831 (Print settings not persistent).
Printing. Fix for Bug #508529 (Printing rastered image offsets the page).
Fixed bugs:
- https://launchpad.net/bugs/264831
- https://launchpad.net/bugs/508529
(bzr r13509)
Diffstat (limited to 'src/ui/dialog/print.cpp')
| -rw-r--r-- | src/ui/dialog/print.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ui/dialog/print.cpp b/src/ui/dialog/print.cpp index 03ac9dc64..4d8d512df 100644 --- a/src/ui/dialog/print.cpp +++ b/src/ui/dialog/print.cpp @@ -18,6 +18,7 @@ #include <windows.h> #endif +#include "preferences.h" #include "print.h" #include <gtkmm/stock.h> @@ -44,14 +45,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"; @@ -92,7 +97,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); } @@ -106,6 +111,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(); |
