poppler/CairoOutputDev.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
New commits: commit b1f8147024efcabc6cf8b122cec2d1d785414300 Author: Carlos Garcia Campos <[email protected]> Date: Fri Jul 9 12:29:14 2010 +0200 [cairo] Use ceil to convert double to int in tilingPatternFill() Fixes rendering of page 2 of document attached to bug #28954. diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc index 01ff92c..65fac76 100644 --- a/poppler/CairoOutputDev.cc +++ b/poppler/CairoOutputDev.cc @@ -718,6 +718,7 @@ GBool CairoOutputDev::tilingPatternFill(GfxState *state, Object *str, cairo_t *old_cairo; double xMin, yMin, xMax, yMax; double width, height; + int surface_width, surface_height; width = bbox[2] - bbox[0]; height = bbox[3] - bbox[1]; @@ -726,9 +727,12 @@ GBool CairoOutputDev::tilingPatternFill(GfxState *state, Object *str, return gFalse; /* TODO: implement the other cases here too */ + surface_width = (int) ceil (width); + surface_height = (int) ceil (height); + surface = cairo_surface_create_similar (cairo_get_target (cairo), CAIRO_CONTENT_COLOR_ALPHA, - width, height); + surface_width, surface_height); if (cairo_surface_status (surface)) return gFalse; @@ -751,7 +755,7 @@ GBool CairoOutputDev::tilingPatternFill(GfxState *state, Object *str, state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax); cairo_rectangle (cairo, xMin, yMin, xMax - xMin, yMax - yMin); - cairo_matrix_init_scale (&matrix, (int)width / width, (int)height / height); + cairo_matrix_init_scale (&matrix, surface_width / width, surface_height / height); cairo_pattern_set_matrix (pattern, &matrix); cairo_matrix_init (&matrix, mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]); _______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
