diff --git a/ChangeLog b/ChangeLog index e36c52ea7..2be574b7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-08-02 Emmanuele Bassi + + * clutter/clutter-color.c (clutter_color_subtract): Invert the + operands and match what the function says it does. + 2007-08-01 Matthew Allum * clutter/clutter-color.c: (clutter_color_from_pixel): diff --git a/clutter/clutter-color.c b/clutter/clutter-color.c index 2b2f353d7..3218ca6a6 100644 --- a/clutter/clutter-color.c +++ b/clutter/clutter-color.c @@ -74,7 +74,9 @@ clutter_color_add (const ClutterColor *src1, * @dest: return location for the result * * Subtracts @src2 from @src1 and saves the resulting - * color inside @dest. + * color inside @dest. This function assumes that the components + * of @src1 are greater than the components of @src2; the result is, + * otherwise, undefined. * * The alpha channel of @dest is set as the minimum value * between the alpha channels of @src1 and @src2. @@ -88,9 +90,9 @@ clutter_color_subtract (const ClutterColor *src1, g_return_if_fail (src2 != NULL); g_return_if_fail (dest != NULL); - dest->red = CLAMP (src2->red - src1->red, 0, 255); - dest->green = CLAMP (src2->green - src1->green, 0, 255); - dest->blue = CLAMP (src2->blue - src1->blue, 0, 255); + dest->red = CLAMP (src1->red - src2->red, 0, 255); + dest->green = CLAMP (src1->green - src2->green, 0, 255); + dest->blue = CLAMP (src1->blue - src2->blue, 0, 255); dest->alpha = MIN (src1->alpha, src2->alpha); }