double dy = fraction - _last_drag_fraction;
_last_drag_fraction = fraction;
- /* clamp y so that the "lowest" point hits the bottom but goes no further */
+ /* clamp y so that the "lowest" point hits the bottom but goes no further
+ and similarly with the "highest" and the top
+ */
for (list<ControlPoint*>::iterator i = _drag_points.begin(); i != _drag_points.end(); ++i) {
double const y = ((_height - (*i)->get_y()) / _height) + dy;
if (y < 0) {
dy -= y;
}
+ if (y > 1) {
+ dy -= (y - 1);
+ }
}
for (list<ControlPoint*>::iterator i = _drag_points.begin(); i != _drag_points.end(); ++i) {
}
-void AutomationLine::set_colors() {
- set_line_color( ARDOUR_UI::config()->canvasvar_AutomationLine.get() );
+void AutomationLine::set_colors()
+{
+ set_line_color (ARDOUR_UI::config()->canvasvar_AutomationLine.get());
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
(*i)->show_color (false, !points_visible);
}
}
uint32_t const N = _line->npoints ();
- AutomationList::const_iterator j = the_list->begin ();
for (uint32_t i = 0; i < N; ++i) {
ControlPoint* p = _line->nth (i);
- list<AudioRange>::const_iterator k = _ranges.begin ();
- while (k != _ranges.end() && (k->start >= (*j)->when || k->end <= (*j)->when)) {
- ++k;
+ list<AudioRange>::const_iterator j = _ranges.begin ();
+ while (j != _ranges.end() && (j->start >= (*p->model())->when || j->end <= (*p->model())->when)) {
+ ++j;
}
- if (k != _ranges.end()) {
+ if (j != _ranges.end()) {
points.push_back (p);
}
-
- ++j;
}
}