perf/chart: Tweak labels on right not to fall off the edge

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-01-04 10:26:04 +00:00
parent 0a10982f8c
commit 56a835eb9d
2 changed files with 9 additions and 8 deletions

1
perf/.gitignore vendored
View file

@ -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

View file

@ -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);