- /* PORT GROUP NAME */
-
- double x = 0;
- double y = 0;
-
- if (_matrix->arrangement() == PortMatrix::TOP_TO_RIGHT) {
- x = slanted_height() / tan (angle());
- y = _highest_group_name + name_pad();
- } else {
- x = 0;
- y = _height - name_pad();
- }
-
- int g = 0;
- for (PortGroupList::List::const_iterator i = _matrix->columns()->begin(); i != _matrix->columns()->end(); ++i) {
-
- /* compute width of this group */
- uint32_t w = 0;
- if (!(*i)->visible() || (*i)->bundles().empty()) {
- w = column_width ();
- } else {
- if (_matrix->show_only_bundles()) {
- w = (*i)->bundles().size() * column_width();
- } else {
- w = (*i)->total_channels() * column_width();
- }
- }
-
- /* rectangle */
- set_source_rgb (cr, get_a_group_colour (g));
- double const rh = _highest_group_name + 2 * name_pad();
- if (_matrix->arrangement() == PortMatrix::TOP_TO_RIGHT) {
- cairo_rectangle (cr, x, 0, w, rh);
- } else {
- cairo_rectangle (cr, x, _height - rh, w, rh);
- }
- cairo_fill (cr);
-
- string const upper = Glib::ustring ((*i)->name).uppercase ();
- pair<string, double> const display = fit_to_pixels (cr, upper, w);
-
- /* plot it */
- set_source_rgb (cr, text_colour());
- cairo_move_to (cr, x + (w - display.second) / 2, y);
- cairo_show_text (cr, display.first.c_str());
-
- x += w;
- ++g;
-
- }
-