aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dw-hdfsee.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c
index 9c42bf5b..115d29f4 100644
--- a/src/dw-hdfsee.c
+++ b/src/dw-hdfsee.c
@@ -146,6 +146,7 @@ static double ring_radius(struct image *image, double d)
static void show_ring(cairo_t *cr, DisplayWindow *dw,
double d, const char *label)
{
+ cairo_text_extents_t size;
cairo_identity_matrix(cr);
cairo_translate(cr, -dw->min_x/dw->binning, dw->max_y/dw->binning);
cairo_arc(cr, 0.0, 0.0, ring_radius(dw->image, d)/dw->binning,
@@ -153,10 +154,15 @@ static void show_ring(cairo_t *cr, DisplayWindow *dw,
cairo_set_source_rgb(cr, 1.0, 0.0, 0.0);
cairo_set_line_width(cr, 1.0);
cairo_stroke(cr);
+
cairo_rotate(cr, -M_PI/4.0);
cairo_translate(cr, 0.0,
ring_radius(dw->image, d)/dw->binning-5.0);
cairo_set_font_size(cr, 20.0);
+ cairo_text_extents(cr, label, &size);
+ cairo_translate(cr, -size.width/2.0, 0.0);
+
+
cairo_show_text(cr, label);
cairo_fill(cr);
}