X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fgroup_tabs.cc;h=ab4dcd19231bba5b7b8821c51db68cef01bd72fb;hb=82f8214277dbc06532beb9b42a96ac155af6c5f2;hp=faf5ab8edce2cbb544e4954430b8bad2dde61c77;hpb=04ac05a26d4f341aca6324626998569e4966ea11;p=ardour.git diff --git a/gtk2_ardour/group_tabs.cc b/gtk2_ardour/group_tabs.cc index faf5ab8edc..ab4dcd1923 100644 --- a/gtk2_ardour/group_tabs.cc +++ b/gtk2_ardour/group_tabs.cc @@ -244,8 +244,8 @@ GroupTabs::render (cairo_t* cr) /** Convert a click position to a tab. * @param c Click position. - * @param prev Filled in with the previous tab to the click, or 0. - * @param next Filled in with the next tab after the click, or 0. + * @param prev Filled in with the previous tab to the click, or _tabs.end(). + * @param next Filled in with the next tab after the click, or _tabs.end(). * @return Tab under the click, or 0. */ @@ -259,6 +259,7 @@ GroupTabs::click_to_tab (double c, list::iterator* prev, list::iterato while (i != _tabs.end()) { if (i->from > c) { + *next = i; break; } @@ -275,14 +276,6 @@ GroupTabs::click_to_tab (double c, list::iterator* prev, list::iterato ++i; } - if (i != _tabs.end()) { - *next = i; - - if (under) { - (*next)++; - } - } - return under; }