Fix problems with dragging route groups so that they are too small.
git-svn-id: svn://localhost/ardour2/branches/3.0@5240 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
cfbec44c33
commit
442eef90ab
@ -53,12 +53,14 @@ EditorGroupTabs::compute_tabs () const
|
||||
if (g != tab.group) {
|
||||
if (tab.group) {
|
||||
tab.to = y;
|
||||
tab.last_ui_size = (*i)->effective_height ();
|
||||
tabs.push_back (tab);
|
||||
}
|
||||
|
||||
tab.from = y;
|
||||
tab.group = g;
|
||||
tab.colour = (*i)->color ();
|
||||
tab.first_ui_size = (*i)->effective_height ();
|
||||
}
|
||||
|
||||
y += (*i)->effective_height ();
|
||||
|
@ -114,16 +114,33 @@ GroupTabs::on_motion_notify_event (GdkEventMotion* ev)
|
||||
}
|
||||
|
||||
if (_drag_from) {
|
||||
|
||||
double f = _dragging->from + p - _drag_last;
|
||||
|
||||
if (f < _drag_limit) {
|
||||
f = _drag_limit;
|
||||
}
|
||||
|
||||
double const t = _dragging->to - _dragging->last_ui_size;
|
||||
if (f > t) {
|
||||
f = t;
|
||||
}
|
||||
|
||||
_dragging->from = f;
|
||||
|
||||
} else {
|
||||
|
||||
double t = _dragging->to + p - _drag_last;
|
||||
|
||||
if (t > _drag_limit) {
|
||||
t = _drag_limit;
|
||||
}
|
||||
|
||||
double const f = _dragging->from + _dragging->first_ui_size;
|
||||
if (t < f) {
|
||||
t = f;
|
||||
}
|
||||
|
||||
_dragging->to = t;
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,8 @@ protected:
|
||||
double to;
|
||||
Gdk::Color colour;
|
||||
ARDOUR::RouteGroup* group;
|
||||
double first_ui_size;
|
||||
double last_ui_size;
|
||||
};
|
||||
|
||||
private:
|
||||
|
@ -55,12 +55,14 @@ MixerGroupTabs::compute_tabs () const
|
||||
if (g != tab.group) {
|
||||
if (tab.group) {
|
||||
tab.to = x;
|
||||
tab.last_ui_size = (*i)->get_width ();
|
||||
tabs.push_back (tab);
|
||||
}
|
||||
|
||||
tab.from = x;
|
||||
tab.group = g;
|
||||
tab.colour = (*i)->color ();
|
||||
tab.first_ui_size = (*i)->get_width ();
|
||||
}
|
||||
|
||||
x += (*i)->get_width ();
|
||||
|
Loading…
Reference in New Issue
Block a user