summaryrefslogtreecommitdiff
path: root/pdf
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-04-19 17:33:42 +0100
committerRobin Watts <robin.watts@artifex.com>2012-04-19 19:04:52 +0100
commitcc89f3525dfc852f6491d80d6e5c1194d431ab38 (patch)
tree2cf2b91e90c092a3a91c8fa87a635a3b9f443d5a /pdf
parent15099174daf3ddebb6c81f9fcafcbc1256f9435e (diff)
downloadmupdf-cc89f3525dfc852f6491d80d6e5c1194d431ab38.tar.xz
Bug 692847: Tiling problem fix.
The test in mupdf for 'is more than one tile needed' is wrong, as it assumes that tile bboxes start at 0. Fix that, and everything else should work OK.
Diffstat (limited to 'pdf')
-rw-r--r--pdf/pdf_interpret.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/pdf/pdf_interpret.c b/pdf/pdf_interpret.c
index 5b2f75a1..a11b8c30 100644
--- a/pdf/pdf_interpret.c
+++ b/pdf/pdf_interpret.c
@@ -1264,18 +1264,19 @@ pdf_show_pattern(pdf_csi *csi, pdf_pattern *pat, fz_rect area, int what)
ptm = fz_concat(pat->matrix, csi->top_ctm);
invptm = fz_invert_matrix(ptm);
- /* patterns are painted using the ctm in effect at the beginning of the content stream */
- /* get bbox of shape in pattern space for stamping */
+ /* patterns are painted using the ctm in effect at the beginning
+ * of the content stream. area = bbox of shape to be filled in
+ * device space. Map it back to pattern space. */
area = fz_transform_rect(invptm, area);
/* When calculating the number of tiles required, we adjust by a small
* amount to allow for rounding errors. By choosing this amount to be
* smaller than 1/256, we guarantee we won't cause problems that will
* be visible even under our most extreme antialiasing. */
- x0 = floorf(area.x0 / pat->xstep + 0.001);
- y0 = floorf(area.y0 / pat->ystep + 0.001);
- x1 = ceilf(area.x1 / pat->xstep - 0.001);
- y1 = ceilf(area.y1 / pat->ystep - 0.001);
+ x0 = floorf((area.x0 - pat->bbox.x0) / pat->xstep + 0.001);
+ y0 = floorf((area.y0 - pat->bbox.y0) / pat->ystep + 0.001);
+ x1 = ceilf((area.x1 - pat->bbox.x0) / pat->xstep - 0.001);
+ y1 = ceilf((area.y1 - pat->bbox.y0) / pat->ystep - 0.001);
oldtopctm = csi->top_ctm;
oldtop = csi->gtop;