From 7cf04e2b9d5ccbec5059c5f2e1af6aaf1f5dc657 Mon Sep 17 00:00:00 2001 From: nick_m Date: Sun, 5 Apr 2015 03:35:27 +1000 Subject: Port matrix useability fix. When a page has changed, leave the adjustment where it is on the axis whose size remains the same. On the changed axis, set the scroller to zero. --- gtk2_ardour/port_matrix.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc index ebf6413d39..40cc80a350 100644 --- a/gtk2_ardour/port_matrix.cc +++ b/gtk2_ardour/port_matrix.cc @@ -248,17 +248,26 @@ PortMatrix::setup_scrollbars () { Adjustment* a = _hscroll.get_adjustment (); a->set_lower (0); - a->set_upper (_body->full_scroll_width()); a->set_page_size (_body->alloc_scroll_width()); a->set_step_increment (32); a->set_page_increment (128); + /* Set the adjustment to zero if the size has changed.*/ + if (a->get_upper() != _body->full_scroll_width()) { + a->set_upper (_body->full_scroll_width()); + a->set_value (0); + } + a = _vscroll.get_adjustment (); a->set_lower (0); - a->set_upper (_body->full_scroll_height()); a->set_page_size (_body->alloc_scroll_height()); a->set_step_increment (32); a->set_page_increment (128); + + if (a->get_upper() != _body->full_scroll_height()) { + a->set_upper (_body->full_scroll_height()); + a->set_value (0); + } } /** Disassociate all of our ports from each other */ -- cgit v1.2.3