[cairo-commit] src/cairo-pdf-surface.c
Adrian Johnson
ajohnson at kemper.freedesktop.org
Sun Jul 12 03:02:39 PDT 2009
src/cairo-pdf-surface.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
New commits:
commit 0d44416b9dd8149032039cf44ea14bf4867f3c54
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Sun Jul 12 19:21:28 2009 +0930
PDF: Don't round pattern y location to an integer
Using cairo_surface_get_extents() to get page height does not work
when the page height is not an integer.
http://lists.cairographics.org/archives/cairo/2009-July/017570.html
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 6be6245..47fdb1b 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -2186,7 +2186,6 @@ _cairo_pdf_surface_emit_surface_pattern (cairo_pdf_surface_t *surface,
cairo_matrix_t cairo_p2d, pdf_p2d;
cairo_extend_t extend = cairo_pattern_get_extend (&pattern->base);
double xstep, ystep;
- cairo_rectangle_int_t surface_extents;
int pattern_width = 0; /* squelch bogus compiler warning */
int pattern_height = 0; /* squelch bogus compiler warning */
int origin_x = 0; /* squelch bogus compiler warning */
@@ -2217,10 +2216,6 @@ _cairo_pdf_surface_emit_surface_pattern (cairo_pdf_surface_t *surface,
if (unlikely (status))
return status;
- status = _cairo_surface_get_extents (&surface->base, &surface_extents);
- if (unlikely (status))
- return status;
-
bbox_x = pattern_width;
bbox_y = pattern_height;
switch (extend) {
@@ -2303,10 +2298,7 @@ _cairo_pdf_surface_emit_surface_pattern (cairo_pdf_surface_t *surface,
/* cairo_pattern_set_matrix ensures the matrix is invertible */
assert (status == CAIRO_STATUS_SUCCESS);
- cairo_matrix_init_identity (&pdf_p2d);
- cairo_matrix_translate (&pdf_p2d, 0.0, surface_extents.height);
- cairo_matrix_scale (&pdf_p2d, 1.0, -1.0);
- cairo_matrix_multiply (&pdf_p2d, &cairo_p2d, &pdf_p2d);
+ cairo_matrix_multiply (&pdf_p2d, &cairo_p2d, &surface->cairo_to_pdf);
cairo_matrix_translate (&pdf_p2d, -origin_x, -origin_y);
cairo_matrix_translate (&pdf_p2d, 0.0, pattern_height);
cairo_matrix_scale (&pdf_p2d, 1.0, -1.0);
More information about the cairo-commit
mailing list