From cca8b8cda0d25459019bb10a59616fec108b825e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 1 Nov 2011 21:17:05 +0000 Subject: Fix out-of-whack notebook tabs wrt their contents in certain port matrices, broken by my recent tinkering (#4422). git-svn-id: svn://localhost/ardour2/branches/3.0@10384 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/port_matrix.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gtk2_ardour/port_matrix.cc') diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc index 8d4a8e5696..7125780ccf 100644 --- a/gtk2_ardour/port_matrix.cc +++ b/gtk2_ardour/port_matrix.cc @@ -878,9 +878,18 @@ PortMatrix::visible_ports (int d) const PortGroupList const & p = _ports[d]; PortGroupList::List::const_iterator j = p.begin (); + /* The logic to compute the index here is a bit twisty because for + the TOP_TO_RIGHT arrangement we reverse the order of the vertical + tabs in setup_notebooks (). + */ + int n = 0; if (d == _row_index) { - n = p.size() - _vnotebook.get_current_page () - 1; + if (_arrangement == LEFT_TO_BOTTOM) { + n = p.size() - _vnotebook.get_current_page () - 1; + } else { + n = _vnotebook.get_current_page (); + } } else { n = _hnotebook.get_current_page (); } -- cgit v1.2.3