Subtract x_off/y_off before conversion to integer.
authorSøren Sandmann Pedersen <sandmann@redhat.com>
Tue, 23 Jun 2009 20:55:53 +0000 (16:55 -0400)
committerSøren Sandmann Pedersen <sandmann@redhat.com>
Tue, 23 Jun 2009 20:58:32 +0000 (16:58 -0400)
They are fixed-point values, not integers.

Bug 22437, reported by Michel Dänzer.

pixman/pixman-bits-image.c

index 797bf85..e5d0bd0 100644 (file)
@@ -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;