diff options
author | Robin Gareus <robin@gareus.org> | 2017-01-30 11:46:55 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-01-30 11:47:06 +0100 |
commit | 366a247306cf06e69e7a839a026e35b71a5d7c6f (patch) | |
tree | 2073c6064e856f1d8910ced266a324aa0e3e8058 /gtk2_ardour/mixer_ui.cc | |
parent | ab052d056591b200851f86436f3e3ef671a5e504 (diff) |
left/right align mixer-strips
Diffstat (limited to 'gtk2_ardour/mixer_ui.cc')
-rw-r--r-- | gtk2_ardour/mixer_ui.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 3ea5b069f7..59507b7ffc 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -1601,13 +1601,11 @@ 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 + 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) { - x0 -= half_page; - } + if (x0 < adj->get_value()) { adj->set_value (max (adj->get_lower(), min (adj->get_upper(), (double) x0))); + } else if (x0 + alloc.get_width() >= adj->get_value() + adj->get_page_size()) { + int x1 = x0 + alloc.get_width() - adj->get_page_size(); + adj->set_value (max (adj->get_lower(), min (adj->get_upper(), (double) x1))); } } |