13
0

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:
Carl Hetherington 2009-06-22 00:33:31 +00:00
parent cfbec44c33
commit 442eef90ab
4 changed files with 23 additions and 0 deletions

View File

@ -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 ();

View File

@ -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;
}

View File

@ -41,6 +41,8 @@ protected:
double to;
Gdk::Color colour;
ARDOUR::RouteGroup* group;
double first_ui_size;
double last_ui_size;
};
private:

View File

@ -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 ();