diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-04 10:26:04 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-11 12:43:43 +0000 |
commit | 56a835eb9df7055922dccbc77ba48bd12e07f342 (patch) | |
tree | 995ad38ade1dbd0d54e0b35597e80f89ed7cc8cf /perf | |
parent | 0a10982f8c4f08018f50ec73663761ccf7b9c839 (diff) |
perf/chart: Tweak labels on right not to fall off the edge
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'perf')
-rw-r--r-- | perf/.gitignore | 1 | ||||
-rw-r--r-- | perf/cairo-perf-chart.c | 16 |
2 files changed, 9 insertions, 8 deletions
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); |