mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
left/right align mixer-strips
This commit is contained in:
parent
ab052d0565
commit
366a247306
1 changed files with 4 additions and 6 deletions
|
|
@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue