diff --git a/ChangeLog b/ChangeLog index 8d0893fc1..febaa2134 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2008-11-06 Neil Roberts + + Bug 1230 - Pick fails on low precision color buffers + + * clutter/clutter-main.c (_clutter_id_to_color): When using fuzzy + picking to pick a color for an actor, it would previously set the + fuzzy bit and then all but the most significant of the remaining + unused bits. This meant that for 16-bit displays it would end up + with a strange pattern for the unused bits like 1011 which could + cause it to round up. Now it just sets all but the most + significant of all of the unused bits giving a pattern like + 0111. Thanks to Guy Zadickario for the patch. + 2008-11-06 Neil Roberts * clutter/cogl/gles/cogl.c (cogl_perspective): diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index 4b00fbd2f..f68e89020 100644 --- a/clutter/clutter-main.c +++ b/clutter/clutter-main.c @@ -298,16 +298,16 @@ _clutter_id_to_color (guint id, ClutterColor *col) * driver / hw implementation. */ if (ctx->fb_r_mask_used != ctx->fb_r_mask) - red = red * 2 + 1; + red = red * 2; if (ctx->fb_g_mask_used != ctx->fb_g_mask) - green = green * 2 + 1; + green = green * 2; if (ctx->fb_b_mask_used != ctx->fb_b_mask) - blue = blue * 2 + 1; + blue = blue * 2; /* shift up to be full 8bit values */ - red = (red << (8 - ctx->fb_r_mask)) | (0xff >> (ctx->fb_r_mask + 1)); - green = (green << (8 - ctx->fb_g_mask)) | (0xff >> (ctx->fb_g_mask + 1)); - blue = (blue << (8 - ctx->fb_b_mask)) | (0xff >> (ctx->fb_b_mask + 1)); + red = (red << (8 - ctx->fb_r_mask)) | (0x7f >> (ctx->fb_r_mask_used)); + green = (green << (8 - ctx->fb_g_mask)) | (0x7f >> (ctx->fb_g_mask_used)); + blue = (blue << (8 - ctx->fb_b_mask)) | (0x7f >> (ctx->fb_b_mask_used)); col->red = red; col->green = green;