+ if (_matrix->show_only_bundles()) {
+ x += grid_spacing();
+ } else {
+ x += _matrix->count_of_our_type_min_1 ((*i)->bundle->nchannels()) * grid_spacing();
+ }
+
+ ++N;
+ }
+
+ /* PORT NAMES */
+
+ if (!_matrix->show_only_bundles()) {
+ x = 0;
+ N = 0;
+
+ for (PortGroup::BundleList::const_iterator i = bundles.begin (); i != bundles.end(); ++i) {
+
+ uint32_t const C = _matrix->count_of_our_type ((*i)->bundle->nchannels ());
+
+ for (uint32_t j = 0; j < C; ++j) {
+ Gdk::Color c = (*i)->has_colour ? (*i)->colour : get_a_bundle_colour (N);
+
+ ARDOUR::BundleChannel bc (
+ (*i)->bundle,
+ (*i)->bundle->type_channel_to_overall (_matrix->type (), j)
+ );
+
+ render_channel_name (cr, background_colour (), c, x, 0, bc);
+ x += grid_spacing();
+ }
+
+ if (C == 0) {
+ x += grid_spacing ();
+ }
+
+ ++N;
+ }
+ }
+}
+
+double
+PortMatrixColumnLabels::component_to_parent_x (double x) const
+{
+ return x - _body->xoffset() + _parent_rectangle.get_x();
+}
+
+double
+PortMatrixColumnLabels::parent_to_component_x (double x) const
+{
+ return x + _body->xoffset() - _parent_rectangle.get_x();
+}
+
+double
+PortMatrixColumnLabels::component_to_parent_y (double y) const
+{
+ /* Column labels don't scroll vertically, so y conversion does not depend on yoffset */
+ return y + _parent_rectangle.get_y();
+}
+
+double
+PortMatrixColumnLabels::parent_to_component_y (double y) const
+{
+ /* Column labels don't scroll vertically, so y conversion does not depend on yoffset */
+ return y - _parent_rectangle.get_y();
+}
+
+void
+PortMatrixColumnLabels::mouseover_changed (list<PortMatrixNode> const &)
+{
+ list<PortMatrixNode> const m = _body->mouseover ();
+ for (list<PortMatrixNode>::const_iterator i = m.begin(); i != m.end(); ++i) {
+
+ ARDOUR::BundleChannel c = i->column;
+ ARDOUR::BundleChannel r = i->row;
+
+ if (PortMatrix::bundle_with_channels (c.bundle) && PortMatrix::bundle_with_channels (r.bundle)) {
+ add_channel_highlight (c);
+ } else if (c.bundle) {
+ _body->highlight_associated_channels (_matrix->column_index(), c);
+ }
+ }
+}
+
+vector<pair<double, double> >
+PortMatrixColumnLabels::port_name_shape (double xoff, double yoff) const
+{
+ vector<pair<double, double> > shape;
+
+ double const lc = _longest_channel_name + name_pad();
+ double const w = grid_spacing();
+
+ if (_matrix->arrangement() == PortMatrix::LEFT_TO_BOTTOM) {
+
+ double x_ = xoff + _height / tan (angle()) + w;
+ double y_ = yoff;
+ shape.push_back (make_pair (x_, y_));