diff options
author | Robin Gareus <robin@gareus.org> | 2016-10-16 21:27:07 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-10-16 21:27:30 +0200 |
commit | 7e5e95d7dbaba4d1280d68b3880a736351a5280d (patch) | |
tree | 1db8d135b43adc10c73cc80264e0056fbaa2c059 /gtk2_ardour/mixer_ui.cc | |
parent | 1c9dbb5242b4b1b5dd052f5de22d0e2434d89053 (diff) |
refine 29f604418, move selected track to left-edge (if possible)
Diffstat (limited to 'gtk2_ardour/mixer_ui.cc')
-rw-r--r-- | gtk2_ardour/mixer_ui.cc | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index de530340a2..282c68798b 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -1504,13 +1504,11 @@ Mixer_UI::move_stripable_into_view (boost::shared_ptr<ARDOUR::Stripable> s) } bool found = false; int x0 = 0; - int x1 = 0; 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); - x1 = x0 + (*i)->get_width (); break; } } @@ -1521,15 +1519,7 @@ Mixer_UI::move_stripable_into_view (boost::shared_ptr<ARDOUR::Stripable> s) Adjustment* adj = scroller.get_hscrollbar()->get_adjustment(); int sl = adj->get_value(); int sr = sl + scroller.get_width(); - - if (x0 < sl) { - scroller.get_hscrollbar()->set_value (max (adj->get_lower(), min (adj->get_upper(), x0 - 1.0))); - } - else if (x1 > sr) { - // TODO: align left side of left most track, if possible - double re = x1 - scroller.get_width(); - scroller.get_hscrollbar()->set_value (max (adj->get_lower(), min (adj->get_upper(), re))); - } + scroller.get_hscrollbar()->set_value (max (adj->get_lower(), min (adj->get_upper(), x0 - 1.0))); } void |