From 570b921e47baaea9c195483bb13ae25bb01ad427 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 28 Jan 2017 17:08:40 +0100 Subject: [PATCH] further improvement to Mixer_UI::move_stripable_into_view() --- gtk2_ardour/mixer_ui.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index a0e4322d40..3ea5b069f7 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -1585,11 +1585,13 @@ Mixer_UI::move_stripable_into_view (boost::shared_ptr s) #endif bool found = false; int x0 = 0; + Gtk::Allocation alloc; for (list::const_iterator i = strips.begin(); i != strips.end(); ++i) { if ((*i)->route() == s) { int y; found = true; (*i)->translate_coordinates (strip_packer, 0, 0, x0, y); + alloc = (*i)->get_allocation (); break; } } @@ -1599,7 +1601,7 @@ Mixer_UI::move_stripable_into_view (boost::shared_ptr s) Adjustment* adj = scroller.get_hscrollbar()->get_adjustment(); - if ((x0 < adj->get_value()) || x0 >= (adj->get_value() + adj->get_page_size())) { + if ((x0 < adj->get_value()) || (x0 + alloc.get_width()) >= (adj->get_value() + adj->get_page_size())) { /* try to put left edge of strip in the middle */ double half_page = adj->get_page_size() / 2.0; if (x0 >= half_page) { -- 2.30.2