diff options
author | Carl Hetherington <carl@carlh.net> | 2010-01-02 01:32:14 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-01-02 01:32:14 +0000 |
commit | 9a6532def285e08e7de5ce8f44115c9278f918e5 (patch) | |
tree | 2ce803edaf76442b3d2a984c5dc6b8e2adc6b441 /gtk2_ardour | |
parent | 85d08944759b161bd4e56d9a96c015ce160fddaf (diff) |
Stop automation drags when they hit their lowest point, so as to prevent automation curves being lost by dragging things too far downwards.
git-svn-id: svn://localhost/ardour2/branches/3.0@6434 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/automation_line.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index 0c568ee55a..ac50ac44db 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -767,10 +767,17 @@ AutomationLine::drag_motion (nframes_t x, float fraction, bool with_push) drag_distance += dx; drag_x = x; - double const dy = fraction - _last_drag_fraction; - + double dy = fraction - _last_drag_fraction; _last_drag_fraction = fraction; + /* clamp y so that the "lowest" point hits the bottom but goes no further */ + 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; + } + } + for (list<ControlPoint*>::iterator i = _drag_points.begin(); i != _drag_points.end(); ++i) { modify_view_point ( |