No highlighting at all when mouse is over a collapsed group. Fix crash on clicking in a collapsed group.

git-svn-id: svn://localhost/ardour2/branches/3.0@5388 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2009-07-19 21:23:16 +00:00
parent 1efee9951a
commit 82f31ffc79
3 changed files with 14 additions and 7 deletions

View file

@ -270,7 +270,7 @@ void
PortMatrixColumnLabels::mouseover_changed (PortMatrixNode const &) PortMatrixColumnLabels::mouseover_changed (PortMatrixNode const &)
{ {
clear_channel_highlights (); clear_channel_highlights ();
if (_body->mouseover().column.bundle) { if (_body->mouseover().column.bundle && _body->mouseover().row.bundle) {
add_channel_highlight (_body->mouseover().column); add_channel_highlight (_body->mouseover().column);
} }
} }

View file

@ -420,9 +420,10 @@ PortMatrixGrid::button_release (double x, double y, int b, uint32_t t)
} else { } else {
PortMatrixNode const n = position_to_node (x / grid_spacing(), y / grid_spacing()); PortMatrixNode const n = position_to_node (x / grid_spacing(), y / grid_spacing());
PortMatrixNode::State const s = get_association (n); if (n.row.bundle && n.column.bundle) {
PortMatrixNode::State const s = get_association (n);
set_association (n, toggle_state (s)); set_association (n, toggle_state (s));
}
} }
require_render (); require_render ();
@ -619,9 +620,15 @@ PortMatrixGrid::nodes_on_line (int x0, int y0, int x1, int y1) const
for (int x = x0; x <= x1; ++x) { for (int x = x0; x <= x1; ++x) {
if (steep) { if (steep) {
p.push_back (position_to_node (y, x)); PortMatrixNode n = position_to_node (y, x);
if (n.row.bundle && n.column.bundle) {
p.push_back (n);
}
} else { } else {
p.push_back (position_to_node (x, y)); PortMatrixNode n = position_to_node (x, y);
if (n.row.bundle && n.column.bundle) {
p.push_back (n);
}
} }
err += derr; err += derr;

View file

@ -364,7 +364,7 @@ void
PortMatrixRowLabels::mouseover_changed (PortMatrixNode const &) PortMatrixRowLabels::mouseover_changed (PortMatrixNode const &)
{ {
clear_channel_highlights (); clear_channel_highlights ();
if (_body->mouseover().row.bundle) { if (_body->mouseover().column.bundle && _body->mouseover().row.bundle) {
add_channel_highlight (_body->mouseover().row); add_channel_highlight (_body->mouseover().row);
} }
} }