diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-12-19 15:55:06 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-12-19 15:55:06 +0000 |
commit | 30237aad7f8e56bc97af4f74812e92e76c924258 (patch) | |
tree | 15bf33558c8480a7a2df7379b075a227b6be2e13 /gtk2_ardour/automation_line.cc | |
parent | 37906d067e44927e6ad575ff8a757a8837fbb4cf (diff) |
fix push-drags of automation data - previously we did not resync the model with the view for the points that were pushed (i.e. not selected, but moved anyway)
git-svn-id: svn://localhost/ardour2/branches/3.0@13681 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/automation_line.cc')
-rw-r--r-- | gtk2_ardour/automation_line.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index b067757cb0..63b9740c00 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -583,7 +583,7 @@ AutomationLine::start_drag_common (double x, float fraction) * @return x position and y fraction that were actually used (once clamped). */ pair<double, float> -AutomationLine::drag_motion (double const x, float fraction, bool ignore_x, bool with_push) +AutomationLine::drag_motion (double const x, float fraction, bool ignore_x, bool with_push, uint32_t& final_index) { if (_drag_points.empty()) { return pair<double,float> (x,fraction); @@ -662,8 +662,9 @@ AutomationLine::drag_motion (double const x, float fraction, bool ignore_x, bool (*ccp)->move (dx, dy); } if (with_push) { - uint32_t i = contiguous_points.back()->back()->view_index () + 1; + final_index = contiguous_points.back()->back()->view_index () + 1; ControlPoint* p; + uint32_t i = final_index; while ((p = nth (i)) != 0 && p->can_slide()) { p->move_to (p->get_x() + dx, p->get_y(), ControlPoint::Full); reset_line_coords (*p); @@ -688,7 +689,7 @@ AutomationLine::drag_motion (double const x, float fraction, bool ignore_x, bool /** Should be called to indicate the end of a drag */ void -AutomationLine::end_drag () +AutomationLine::end_drag (bool with_push, uint32_t final_index) { if (!_drag_had_movement) { return; @@ -696,6 +697,16 @@ AutomationLine::end_drag () alist->freeze (); sync_model_with_view_points (_drag_points); + + if (with_push) { + ControlPoint* p; + uint32_t i = final_index; + while ((p = nth (i)) != 0 && p->can_slide()) { + sync_model_with_view_point (*p); + ++i; + } + } + alist->thaw (); update_pending = false; |