+ _dragging = false;
+}
+
+
+void
+PortMatrixGrid::draw_extra (cairo_t* cr)
+{
+ set_source_rgba (cr, mouseover_line_colour(), 0.3);
+ cairo_set_line_width (cr, mouseover_line_width());
+
+ list<PortMatrixNode> const m = _body->mouseover ();
+
+ for (list<PortMatrixNode>::const_iterator i = m.begin(); i != m.end(); ++i) {
+
+ double const x = component_to_parent_x (channel_to_position (i->column, _matrix->visible_columns()) * grid_spacing()) + grid_spacing() / 2;
+ double const y = component_to_parent_y (channel_to_position (i->row, _matrix->visible_rows()) * grid_spacing()) + grid_spacing() / 2;
+
+ if (PortMatrix::bundle_with_channels (i->row.bundle) && PortMatrix::bundle_with_channels (i->column.bundle)) {
+
+ cairo_move_to (cr, x, y);
+ if (_matrix->arrangement() == PortMatrix::LEFT_TO_BOTTOM) {
+ cairo_line_to (cr, component_to_parent_x (0), y);
+ } else if (_matrix->arrangement() == PortMatrix::TOP_TO_RIGHT) {
+ cairo_line_to (cr, _parent_rectangle.get_x() + _parent_rectangle.get_width(), y);
+ }
+ cairo_stroke (cr);
+
+ cairo_move_to (cr, x, y);
+ if (_matrix->arrangement() == PortMatrix::LEFT_TO_BOTTOM) {
+ cairo_line_to (cr, x, _parent_rectangle.get_y() + _parent_rectangle.get_height());
+ } else if (_matrix->arrangement() == PortMatrix::TOP_TO_RIGHT) {
+ cairo_line_to (cr, x, component_to_parent_y (0));
+ }
+ cairo_stroke (cr);
+ }
+ }
+
+ if (_dragging && _drag_valid && _moved) {
+
+ list<PortMatrixNode> const p = nodes_on_line (_drag_start_x, _drag_start_y, _drag_x, _drag_y);
+
+ if (!p.empty()) {
+
+ bool const s = toggle_state (_matrix->get_association (p.front()));
+
+ for (list<PortMatrixNode>::const_iterator i = p.begin(); i != p.end(); ++i) {
+ if (s) {
+ draw_association_indicator (
+ cr,
+ component_to_parent_x (channel_to_position (i->column, _matrix->visible_columns()) * grid_spacing ()),
+ component_to_parent_y (channel_to_position (i->row, _matrix->visible_rows()) * grid_spacing ())
+ );
+ } else {
+ draw_empty_square (
+ cr,
+ component_to_parent_x (channel_to_position (i->column, _matrix->visible_columns()) * grid_spacing ()),
+ component_to_parent_y (channel_to_position (i->row, _matrix->visible_rows()) * grid_spacing ())
+ );
+ }
+ }
+ }
+
+ set_source_rgba (cr, association_colour (), 0.3);
+
+ cairo_move_to (
+ cr,
+ component_to_parent_x (_drag_start_x * grid_spacing() + grid_spacing() / 2),
+ component_to_parent_y (_drag_start_y * grid_spacing() + grid_spacing() / 2)