summaryrefslogtreecommitdiff
path: root/draw
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-06-02 17:04:51 +0100
committerRobin Watts <robin.watts@artifex.com>2013-06-03 14:39:26 +0100
commiteeac55c6d5df2f841ae72327fa5347feecbdba60 (patch)
tree51891b5beb354fec6fec7249f9c6f5d41feb9628 /draw
parent9c03e52fcbe65f27955dd3e021b2469f1a15f58c (diff)
downloadmupdf-eeac55c6d5df2f841ae72327fa5347feecbdba60.tar.xz
Fix tile drawing problems with {x,y}step < width/height
As seen in fts_15_1506.pdf
Diffstat (limited to 'draw')
-rw-r--r--draw/draw_device.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/draw/draw_device.c b/draw/draw_device.c
index 3c705369..c6f55224 100644
--- a/draw/draw_device.c
+++ b/draw/draw_device.c
@@ -1866,8 +1866,13 @@ fz_draw_end_tile(fz_device *devp)
fz_intersect_irect(&area, fz_irect_from_rect(&scissor, &scissor_tmp));
/* FIXME: area is a bbox, so FP not appropriate here */
- x0 = floorf(area.x0 / xstep);
- y0 = floorf(area.y0 / ystep);
+ /* In PDF files xstep/ystep can be smaller than view (the area of a
+ * single tile) (see fts_15_1506.pdf for an example). This means that
+ * we have to bias the left hand/bottom edge calculations by the
+ * difference between the step and the width/height of the tile. */
+ /* state[0].scissor = view, transformed by ctm */
+ x0 = floorf((area.x0 + xstep - state[0].scissor.x1 + state[0].scissor.x0) / xstep);
+ y0 = floorf((area.y0 + ystep - state[0].scissor.y1 + state[0].scissor.y0) / ystep);
x1 = ceilf(area.x1 / xstep);
y1 = ceilf(area.y1 / ystep);