From 282f5cf8b821a34bab1e32957913ef8d9f9ee43c Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Thu, 12 Nov 2009 17:54:40 -0500 Subject: [PATCH] Round horizontal sampling points towards northwest. This is a similar change as the top/bottom one, but in this case the rounding is simpler because it's just always rounding down. Based on a patch by M Joonas Pihlaja. --- pixman/pixman-edge-imp.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pixman/pixman-edge-imp.h b/pixman/pixman-edge-imp.h index a30f821..d786ea7 100644 --- a/pixman/pixman-edge-imp.h +++ b/pixman/pixman-edge-imp.h @@ -49,10 +49,14 @@ RASTERIZE_EDGES (pixman_image_t *image, rx = r->x; #if N_BITS == 1 /* For the non-antialiased case, round the coordinates up, in effect - * sampling the center of the pixel. (The AA case does a similar - * adjustment in RENDER_SAMPLES_X) */ - lx += X_FRAC_FIRST(1); - rx += X_FRAC_FIRST(1); + * sampling just slightly to the left of the pixel. This is so that + * when the sample point lies exactly on the line, we round towards + * north-west. + * + * (The AA case does a similar adjustment in RENDER_SAMPLES_X) + */ + lx += X_FRAC_FIRST(1) - pixman_fixed_e; + rx += X_FRAC_FIRST(1) - pixman_fixed_e; #endif /* clip X */ if (lx < 0) -- 2.7.4