refine 29f604418, move selected track to left-edge (if possible)
authorRobin Gareus <robin@gareus.org>
Sun, 16 Oct 2016 19:27:07 +0000 (21:27 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 16 Oct 2016 19:27:30 +0000 (21:27 +0200)
gtk2_ardour/mixer_ui.cc

index de530340a24d2ac31503863836209ddd7c06957c..282c68798b055b3aa4d71e22773db4af2e63051a 100644 (file)
@@ -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