diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-01-07 20:10:18 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-01-07 20:10:18 +0000 |
commit | bc8ccfa768451ce3d37a31df3b4f7a6c26c4708a (patch) | |
tree | bc695240dda63bc2f4b7319a4cde4cb1daa0b143 /gtk2_ardour/automation_line.cc | |
parent | ecbc6672c72278756748862eee5924f07e8be41b (diff) |
fix drags of a single control point in a line where that is the only control point
git-svn-id: svn://localhost/ardour2/branches/3.0@13802 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/automation_line.cc')
-rw-r--r-- | gtk2_ardour/automation_line.cc | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index 63b9740c00..7e60bff2e3 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -507,15 +507,22 @@ AutomationLine::ContiguousControlPoints::ContiguousControlPoints (AutomationLine void AutomationLine::ContiguousControlPoints::compute_x_bounds () { - if (!empty()) { + uint32_t sz = size(); + + if (sz > 0 && sz < line.npoints()) { + /* determine the limits on x-axis motion for this contiguous range of control points */ - + if (front()->view_index() > 0) { before_x = line.nth (front()->view_index() - 1)->get_x(); } - + + /* if our last point has a point after it in the line, + we have an "after" bound + */ + if (back()->view_index() < (line.npoints() - 2)) { after_x = line.nth (back()->view_index() + 1)->get_x(); } @@ -674,8 +681,10 @@ AutomationLine::drag_motion (double const x, float fraction, bool ignore_x, bool /* update actual line coordinates (will queue a redraw) */ - - line->property_points() = line_points; + + if (line_points.size() > 1) { + line->property_points() = line_points; + } } _drag_distance += dx; |