From 4d7c32754abb96b5cbbea6cd98d5ca386ad2a81e Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Wed, 27 Feb 2013 16:21:36 +0000 Subject: Bug 693640: Fix interpolated painting of images going out of range When calculating the texture position for interpolated painting we apply a voodoo correction. This was causing problems by taking us out of bounds; simply add some checks to avoid this taking us out of range. This causes many differences, all small, or progressions. In particular it solves several 'white lines' cases where images didn't quite line up. --- draw/draw_affine.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'draw') diff --git a/draw/draw_affine.c b/draw/draw_affine.c index 32e890f8..c0fe1fea 100644 --- a/draw/draw_affine.c +++ b/draw/draw_affine.c @@ -673,7 +673,11 @@ fz_paint_image_imp(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz * that we have found. */ if (dolerp) { u -= 32768; + if (u < 0) + u = 0; v -= 32768; + if (v < 0) + v = 0; } dp = dst->samples + (unsigned int)(((y - dst->y) * dst->w + (x - dst->x)) * dst->n); -- cgit v1.2.3