[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
This commit is contained in:
Behdad Esfahbod 2006-10-25 21:40:08 -04:00
parent a9f51c2973
commit e1ded5b1e0

View file

@ -2539,6 +2539,11 @@ _cairo_pdf_surface_stroke (void *abstract_surface,
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 *abstract_surface,
_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;