diff options
| author | Aaron Spike <aaron@ekips.org> | 2008-09-05 04:07:55 +0000 |
|---|---|---|
| committer | acspike <acspike@users.sourceforge.net> | 2008-09-05 04:07:55 +0000 |
| commit | 4c435ad1e98a65a0c5eb19ee28b7774e012a01c9 (patch) | |
| tree | 80873db7a1460bf0118db330a1defb0afb9a7d6f /src/extension/internal/cairo-renderer.cpp | |
| parent | convert moveto, lineto and curveto native to Point, instead of going to gdoub... (diff) | |
| download | inkscape-4c435ad1e98a65a0c5eb19ee28b7774e012a01c9.tar.gz inkscape-4c435ad1e98a65a0c5eb19ee28b7774e012a01c9.zip | |
Make rasterization of filters into pdf respect the requested dpi.
This is patch is the result of cooperation between John Cliff, Josh Blocher and myself. There remains an issue with the positioning of filtered objects that originally possessed transforms.
(bzr r6760)
Diffstat (limited to 'src/extension/internal/cairo-renderer.cpp')
| -rw-r--r-- | src/extension/internal/cairo-renderer.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp index be9953ae1..bb4a48d68 100644 --- a/src/extension/internal/cairo-renderer.cpp +++ b/src/extension/internal/cairo-renderer.cpp @@ -410,8 +410,6 @@ static void sp_root_render(SPItem *item, CairoRenderContext *ctx) */ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx) { - g_warning("render as bitmap"); - //the code now was copied from sp_selection_create_bitmap_copy SPDocument *document = SP_OBJECT(item)->document; @@ -443,8 +441,12 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx) // The width and height of the bitmap in pixels - unsigned width = (unsigned) floor ((bbox.x1 - bbox.x0) * res / PX_PER_IN); - unsigned height =(unsigned) floor ((bbox.y1 - bbox.y0) * res / PX_PER_IN); + unsigned width = (unsigned) floor ((bbox.x1 - bbox.x0) * (res / PX_PER_IN)); + unsigned height =(unsigned) floor ((bbox.y1 - bbox.y0) * (res / PX_PER_IN)); + + double scale_x = (bbox.x1 - bbox.x0) / width; + double scale_y = (bbox.y1 - bbox.y0) / height; + // Find out if we have to run a filter gchar const *run = NULL; @@ -482,7 +484,7 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx) shift_x = round (shift_x); shift_y = -round (-shift_y); // this gets correct rounding despite coordinate inversion, remove the negations when the inversion is gone } - t = (Geom::Matrix)(Geom::Scale(1, -1) * (Geom::Matrix)(Geom::Translate (shift_x, shift_y)* eek.inverse())); + t = (Geom::Matrix)(Geom::Scale(scale_x, -scale_y) * (Geom::Matrix)(Geom::Translate (shift_x, shift_y)* eek.inverse())); //t = t * ((Geom::Matrix)ctx->getCurrentState()->transform).inverse(); |
