[cairo-commit] src/cairo-pdf-surface.c

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed Oct 25 18:40:15 PDT 2006


 src/cairo-pdf-surface.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

New commits:
diff-tree e1ded5b1e042c8cefa7f136228d5a63a7bdf84b5 (from a9f51c29733a5124e0d04d8dcc00d55ff3aeb05a)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Oct 25 21:40:08 2006 -0400

    [PDF] Set CTM before path construction
    
    The previous order is undefined according to the PDF spec.  The resulting PDF
    was being misrendered using OS X Preview viewer.  This was reported in this
    thread:
    
      http://lists.freedesktop.org/archives/cairo/2006-October/008271.html

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 6db28ec..39bd695 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -2539,6 +2539,11 @@ _cairo_pdf_surface_stroke (void			*abstr
     info.output = surface->output;
     info.ctm_inverse = ctm_inverse;
 
+    _cairo_output_stream_printf (surface->output,
+				 "q %f %f %f %f %f %f cm\r\n",
+				 ctm->xx, ctm->yx, ctm->xy, ctm->yy,
+				 ctm->x0, ctm->y0);
+
     status = _cairo_path_fixed_interpret (path,
 					  CAIRO_DIRECTION_FORWARD,
 					  _cairo_pdf_path_move_to,
@@ -2547,11 +2552,6 @@ _cairo_pdf_surface_stroke (void			*abstr
 					  _cairo_pdf_path_close_path,
 					  &info);
 
-    _cairo_output_stream_printf (surface->output,
-				 "q %f %f %f %f %f %f cm\r\n",
-				 ctm->xx, ctm->yx, ctm->xy, ctm->yy,
-				 ctm->x0, ctm->y0);
-
     _cairo_output_stream_printf (surface->output, "S Q\r\n");
 
     return status;


More information about the cairo-commit mailing list