From c0047fbfd54d519698a0991111f2440dc8e081b9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Tue, 23 Jun 2009 16:55:53 -0400 Subject: [PATCH] Subtract x_off/y_off before conversion to integer. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit They are fixed-point values, not integers. Bug 22437, reported by Michel Dänzer. --- pixman/pixman-bits-image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c index 797bf85..e5d0bd0 100644 --- a/pixman/pixman-bits-image.c +++ b/pixman/pixman-bits-image.c @@ -414,8 +414,8 @@ bits_image_fetch_convolution_pixels (bits_image_t *image, int32_t x, y, x1, x2, y1, y2; /* Subtract pixman_fixed_e to ensure that 0.5 rounds to 0, not 1 */ - x1 = pixman_fixed_to_int (coords[0] - pixman_fixed_e) - x_off; - y1 = pixman_fixed_to_int (coords[1] - pixman_fixed_e) - y_off; + x1 = pixman_fixed_to_int (coords[0] - pixman_fixed_e - x_off); + y1 = pixman_fixed_to_int (coords[1] - pixman_fixed_e - y_off); x2 = x1 + cwidth; y2 = y1 + cheight; -- 2.7.4