summaryrefslogtreecommitdiff
path: root/gtk2_ardour/mixer_ui.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2017-01-28 17:08:40 +0100
committerPaul Davis <paul@linuxaudiosystems.com>2017-01-28 17:08:40 +0100
commit570b921e47baaea9c195483bb13ae25bb01ad427 (patch)
treed6db2f6bd49db8c9e16be1b6e8a90e210de7b00b /gtk2_ardour/mixer_ui.cc
parentc98abcf2931c3d58a1aa0d82ce7f06801d004423 (diff)
further improvement to Mixer_UI::move_stripable_into_view()
Diffstat (limited to 'gtk2_ardour/mixer_ui.cc')
-rw-r--r--gtk2_ardour/mixer_ui.cc4
1 files changed, 3 insertions, 1 deletions
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<ARDOUR::Stripable> s)
#endif
bool found = false;
int x0 = 0;
+ Gtk::Allocation alloc;
for (list<MixerStrip *>::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<ARDOUR::Stripable> 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) {