- /* rectangle */
- set_source_rgb (cr, get_a_group_colour (g));
- double const rw = _highest_group_name + 2 * name_pad();
- cairo_rectangle (cr, x, y, rw, h);
- cairo_fill (cr);
-
- /* y area available to draw the label in (trying to keep it visible) */
- double const ty = max (y, 0.0);
- double const by = min (y + h, double (_body->alloc_scroll_height ()));
-
- /* hence what abbreviation (or not) we need for the group name */
- string const upper = Glib::ustring ((*i)->name).uppercase ();
- pair<string, double> display = fit_to_pixels (cr, upper, by - ty);
-
- /* plot it */
- set_source_rgb (cr, text_colour());
- cairo_move_to (cr, x + rw - name_pad(), (by + ty + display.second) / 2);
- cairo_save (cr);
- cairo_rotate (cr, - M_PI / 2);
- cairo_show_text (cr, display.first.c_str());
- cairo_restore (cr);
-
- y += h;
- ++g;
- }
-}