From 4b4eb03153babd9db7aacd0274913d8406d1d07c Mon Sep 17 00:00:00 2001 From: Martin Mathieson Date: Wed, 25 Jul 2012 15:34:31 +0000 Subject: [PATCH] Only call cairo_stroke() when the colour changes, and at the end of the long list of elements. Now the graph is like greased lightening! I will look later to see if I can apply the same change to the TCP graphs. svn path=/trunk/; revision=44001 --- ui/gtk/rlc_lte_graph.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/gtk/rlc_lte_graph.c b/ui/gtk/rlc_lte_graph.c index a0b3ae3336..5b09426a20 100644 --- a/ui/gtk/rlc_lte_graph.c +++ b/ui/gtk/rlc_lte_graph.c @@ -1199,6 +1199,8 @@ static void graph_pixmap_draw(struct graph *g) } } } + /* Make sure any remaining lines get drawn */ + cairo_stroke(cr_lines); cairo_destroy(cr_lines); } @@ -1215,6 +1217,8 @@ static void draw_element_line(struct graph *g, struct element *e, cairo_t *cr, /* Set our new colour (if changed) */ if (new_color != NULL) { + /* First draw any previous lines with old colour */ + cairo_stroke(cr); gdk_cairo_set_source_color(cr, new_color); } @@ -1254,7 +1258,6 @@ static void draw_element_line(struct graph *g, struct element *e, cairo_t *cr, /* Draw from first position to second */ cairo_move_to(cr, xx1+0.5, yy1+0.5); cairo_line_to(cr, xx2+0.5, yy2+0.5); - cairo_stroke(cr); } static void axis_pixmaps_create(struct axis *axis)