[Giggle] [PATCH] Made the graph more visually appealing on dark backgrounds.

Mikael Hallendal micke at imendio.com
Fri Feb 8 00:25:20 CET 2008


David Vest skrev:

Hi,

The reason it does both a fill and a stroke is because it draws with two 
different colors as you can see at [1]. It might be though that it needs 
to draw the outer circle in a light color if you have a dark theme.

Best Regards,
   Mikael Hallendal

[1] http://tinyurl.com/ypuc6y

> It also avoids doing both a fill and a stroke for the "external"
> circle - a completely unnecessary operation in this case. Now it skips
> the external circle altogether and instead makes the internal circle
> as big as the external was before.
> ---
>  src/giggle-graph-renderer.c |   11 +----------
>  1 files changed, 1 insertions(+), 10 deletions(-)
> 
> diff --git a/src/giggle-graph-renderer.c b/src/giggle-graph-renderer.c
> index 30578c4..2523665 100644
> --- a/src/giggle-graph-renderer.c
> +++ b/src/giggle-graph-renderer.c
> @@ -330,22 +330,13 @@ giggle_graph_renderer_render (GtkCellRenderer *cell,
>  	}
>  
>  	/* paint circle */
> -	cairo_set_source_rgb (cr, 0, 0, 0);
> -	cairo_arc (cr,
> -		   x + (cur_pos * PATH_SPACE (size)),
> -		   y + (h / 2),
> -		   DOT_RADIUS (size), 0, 2 * G_PI);
> -	cairo_stroke (cr);
> -
> -	/* paint internal circle */
>  	path_state = g_hash_table_lookup (table, GINT_TO_POINTER (cur_pos));
>  	gdk_cairo_set_source_color (cr, &colors[path_state->lower_n_color]);
>  	cairo_arc (cr,
>  		   x + (cur_pos * PATH_SPACE (size)),
>  		   y + (h / 2),
> -		   DOT_RADIUS (size) - 1, 0, 2 * G_PI);
> +		   DOT_RADIUS (size), 0, 2 * G_PI);
>  	cairo_fill (cr);
> -	cairo_stroke (cr);
>  
>  	cairo_destroy (cr);
>  	g_hash_table_destroy (table);



More information about the Giggle mailing list