Code

Fix --export-page-drawing option in PDF, PS and LaTeX export.
authorKrzysztof Kosiński <tweenk.pl@gmail.com>
Sat, 3 Apr 2010 22:19:13 +0000 (00:19 +0200)
committerKrzysztof Kosiński <tweenk.pl@gmail.com>
Sat, 3 Apr 2010 22:19:13 +0000 (00:19 +0200)
src/extension/internal/cairo-renderer.cpp
src/extension/internal/latex-text-renderer.cpp

index 6e4bb3b7e366e8438c235ab21853627eb707c875..52f07059175ca4eb70df166cf4a567d28d868e4a 100644 (file)
@@ -631,12 +631,8 @@ CairoRenderer::setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool page
 
     if (ret && !pageBoundingBox)
     {
-        double high = sp_document_height(doc);
-        if (ctx->_vector_based_target)
-            high *= PT_PER_PX;
-
         Geom::Matrix tp(Geom::Translate(-d.x0 * (ctx->_vector_based_target ? PX_PER_PT : 1.0),
-                                    (d.y1 - high) * (ctx->_vector_based_target ? PX_PER_PT : 1.0)));
+                                        -d.y0 * (ctx->_vector_based_target ? PX_PER_PT : 1.0)));
         ctx->transform(&tp);
     }
     
index 28bba1bebcec4271a54e4cfa7e434525d024825d..1fdf1d7fd04b5c0fb4bb2cb06002d573328d1935 100644 (file)
@@ -501,7 +501,8 @@ LaTeXTextRenderer::setupDocument(SPDocument *doc, bool pageBoundingBox, SPItem *
 
     if (!pageBoundingBox)
     {
-        push_transform( Geom::Translate( - d->min() ) );
+        Geom::Translate t(-d->min()[Geom::X], d->max()[Geom::Y] - sp_document_height(doc));
+        push_transform( t );
     }
 
     // flip y-axis