From 56a835eb9df7055922dccbc77ba48bd12e07f342 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 4 Jan 2012 10:26:04 +0000 Subject: perf/chart: Tweak labels on right not to fall off the edge Signed-off-by: Chris Wilson --- perf/.gitignore | 1 + perf/cairo-perf-chart.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'perf') diff --git a/perf/.gitignore b/perf/.gitignore index 3ac12bbc..02af7a93 100644 --- a/perf/.gitignore +++ b/perf/.gitignore @@ -5,6 +5,7 @@ cairo-perf cairo-perf-micro cairo-perf-print cairo-perf-trace +cairo-perf-chart cairo-perf-compare-backends cairo-perf-diff-files cairo-perf-graph-files diff --git a/perf/cairo-perf-chart.c b/perf/cairo-perf-chart.c index 0ecf8b47..6195f3d8 100644 --- a/perf/cairo-perf-chart.c +++ b/perf/cairo-perf-chart.c @@ -487,10 +487,10 @@ done: cairo_text_extents (c->cr, buf, &extents); cairo_set_source_rgba (c->cr, .75, 0, 0, .95); - cairo_move_to (c->cr, -extents.x_bearing, floor (y) - (extents.height/2 + extents.y_bearing) + .5); + cairo_move_to (c->cr, 1-extents.x_bearing, floor (y) - (extents.height/2 + extents.y_bearing) + .5); cairo_show_text (c->cr, buf); - cairo_move_to (c->cr, c->width-extents.width+extents.x_bearing, floor (y) - (extents.height/2 + extents.y_bearing) + .5); + cairo_move_to (c->cr, c->width-extents.width-1, floor (y) - (extents.height/2 + extents.y_bearing) + .5); cairo_show_text (c->cr, buf); cairo_set_source_rgba (c->cr, .75, 0, 0, .5); @@ -548,17 +548,17 @@ done: cairo_text_extents (c->cr, buf, &extents); cairo_set_source_rgba (c->cr, .75, 0, 0, .95); - cairo_move_to (c->cr, -extents.x_bearing, floor (mid + y) - (extents.height/2 + extents.y_bearing)+ .5); + cairo_move_to (c->cr, 1-extents.x_bearing, floor (mid + y) - (extents.height/2 + extents.y_bearing) + .5); cairo_show_text (c->cr, buf); - cairo_move_to (c->cr, c->width-extents.width+extents.x_bearing, floor (mid + y) - (extents.height/2 + extents.y_bearing)+ .5); + cairo_move_to (c->cr, c->width-extents.width-1, floor (mid + y) - (extents.height/2 + extents.y_bearing) + .5); cairo_show_text (c->cr, buf); cairo_set_source_rgba (c->cr, 0, .75, 0, .95); - cairo_move_to (c->cr, -extents.x_bearing, ceil (mid - y) - (extents.height/2 + extents.y_bearing)+ .5); + cairo_move_to (c->cr, 1-extents.x_bearing, ceil (mid - y) - (extents.height/2 + extents.y_bearing) + .5); cairo_show_text (c->cr, buf); - cairo_move_to (c->cr, c->width-extents.width+extents.x_bearing, ceil (mid - y) - (extents.height/2 + extents.y_bearing)+ .5); + cairo_move_to (c->cr, c->width-extents.width-1, ceil (mid - y) - (extents.height/2 + extents.y_bearing) + .5); cairo_show_text (c->cr, buf); /* trim the dashes to no obscure the labels */ @@ -567,7 +567,7 @@ done: ceil (extents.width + extents.x_bearing + 2), floor (mid + y) + .5); cairo_line_to (c->cr, - floor (c->width - (extents.width + extents.x_bearing + 2)), + floor (c->width - (extents.width + 2)), floor (mid + y) + .5); cairo_stroke (c->cr); @@ -576,7 +576,7 @@ done: ceil (extents.width + extents.x_bearing + 2), ceil (mid - y) + .5); cairo_line_to (c->cr, - floor (c->width - (extents.width + extents.x_bearing + 2)), + floor (c->width - (extents.width + 2)), ceil (mid - y) + .5); cairo_stroke (c->cr); -- cgit v1.2.3