summaryrefslogtreecommitdiff
path: root/source/fitz/draw-device.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-12-24 17:18:55 +0000
committerRobin Watts <robin.watts@artifex.com>2013-12-24 17:20:36 +0000
commit5e7afa8bff944b2e7e2d3d10adbb1ae4958b743f (patch)
treeb6dc0b0f8f6bb90ee450db813bf2147ab33dd8e8 /source/fitz/draw-device.c
parent6b08b13fc4e95f9f0446a7199f1d9b5d9348d2f9 (diff)
downloadmupdf-5e7afa8bff944b2e7e2d3d10adbb1ae4958b743f.tar.xz
Bug 694587: Fix pattern repeat calculation
The pattern repeat calculation should be done in pattern space, but one of the arguments in the calculation was being taken from device space. Fix this. Also only apply the bias in the case where the bias would make it larger. 173 progressions.
Diffstat (limited to 'source/fitz/draw-device.c')
-rw-r--r--source/fitz/draw-device.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c
index a92c88b5..355022f3 100644
--- a/source/fitz/draw-device.c
+++ b/source/fitz/draw-device.c
@@ -1857,9 +1857,15 @@ fz_draw_end_tile(fz_device *devp)
* 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);
+ /* scissor, xstep and area are all in pattern space. */
+ x0 = xstep - scissor.x1 + scissor.x0;
+ if (x0 > 0)
+ x0 = 0;
+ y0 = ystep - scissor.y1 + scissor.y0;
+ if (y0 > 0)
+ y0 = 0;
+ x0 = floorf((area.x0 + x0) / xstep);
+ y0 = floorf((area.y0 + y0) / ystep);
x1 = ceilf(area.x1 / xstep);
y1 = ceilf(area.y1 / ystep);