Re: [Nautilus-list] Text color in sidebar



on 9/16/01 2:43 PM, Alex Larsson at alexl redhat com wrote:

> I just took a look at the eel_background_is_dark() code. I did not compile
> this, but i believe this patch should fix the problem:
> 
> Index: eel-gdk-pixbuf-extensions.c
> ===================================================================
> RCS file: /cvs/gnome/eel/eel/eel-gdk-pixbuf-extensions.c,v
> retrieving revision 1.9
> diff -u -p -r1.9 eel-gdk-pixbuf-extensions.c
> --- eel-gdk-pixbuf-extensions.c    2001/08/15 15:59:24    1.9
> +++ eel-gdk-pixbuf-extensions.c    2001/09/16 21:41:22
> @@ -314,9 +314,9 @@ eel_gdk_pixbuf_average_value (GdkPixbuf
> }
> }
> 
> -    color->red =   (red_total   * 256) / count;
> -    color->green = (green_total * 256) / count;
> -    color->blue =  (blue_total  * 256) / count;
> +    color->red =   (red_total / count) * 256;
> +    color->green = (green_total / count) * 256;
> +    color->blue =  (blue_total / count) *256;
> }
> 
> double

Thanks Alex! Looks great!

I think I have an even nicer fix that keeps the rounding error to a minimum
even with smaller pixbufs. I'll check it in shortly.

    -- Darin





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]