- pair<string, double> const f = fit_to_pixels (cr, g->name(), y2 - y1 - arc_radius * 2);
-
- cairo_text_extents_t ext;
- cairo_text_extents (cr, g->name().c_str(), &ext);
+ if (tab.group) {
+ pair<string, double> const f = fit_to_pixels (cr, tab.group->name(), tab.to - tab.from - arc_radius * 2);
+
+ cairo_text_extents_t ext;
+ cairo_text_extents (cr, tab.group->name().c_str(), &ext);
+
+ cairo_set_source_rgb (cr, 1, 1, 1);
+ cairo_move_to (cr, _width - ext.height / 2, tab.from + (f.second + tab.to - tab.from) / 2);
+ cairo_save (cr);
+ cairo_rotate (cr, - M_PI / 2);
+ cairo_show_text (cr, f.first.c_str());
+ cairo_restore (cr);
+ }
+}