From 7e5e95d7dbaba4d1280d68b3880a736351a5280d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 16 Oct 2016 21:27:07 +0200 Subject: refine 29f604418, move selected track to left-edge (if possible) --- gtk2_ardour/mixer_ui.cc | 12 +----------- 1 file changed, 1 insertion(+), 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 s) } bool found = false; int x0 = 0; - int x1 = 0; 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); - x1 = x0 + (*i)->get_width (); break; } } @@ -1521,15 +1519,7 @@ Mixer_UI::move_stripable_into_view (boost::shared_ptr 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 -- cgit v1.2.3