fix/adjust logic used to display automation lines

This commit is contained in:
Paul Davis 2014-03-04 10:03:14 -05:00
parent 6863bb9d28
commit 836e95d964
1 changed files with 20 additions and 19 deletions

View File

@ -141,6 +141,7 @@ void
AutomationLine::show ()
{
if (_visible & Line) {
cerr << "AL visibile with vis = " << (hex) << _visible << dec << endl;
/* Only show the line there are some points, otherwise we may show an out-of-date line
when automation points have been removed (the line will still follow the shape of the
old points).
@ -150,32 +151,32 @@ AutomationLine::show ()
} else {
line->hide ();
}
} else {
line->hide();
/* if the line is not visible, then no control points should be visible */
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
(*i)->hide ();
}
return;
}
if (_visible & ControlPoints) {
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
(*i)->show ();
}
} else if (_visible & SelectedControlPoints) {
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
if ((*i)->get_selected()) {
if (_visible & ControlPoints) {
cerr << "AL visibile (just cp's with vis = " << (hex) << _visible << dec << endl;
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
(*i)->show ();
} else {
}
} else if (_visible & SelectedControlPoints) {
cerr << "AL visibile (just selected cp's with vis = " << (hex) << _visible << dec << endl;
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
if ((*i)->get_selected()) {
(*i)->show ();
} else {
(*i)->hide ();
}
}
} else {
cerr << "AL visibile (no cp's with vis = " << (hex) << _visible << dec << endl;
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
(*i)->hide ();
}
}
} else {
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
(*i)->hide ();
}
line->hide ();
}
}
void