diff options
author | Colin Fletcher <colin.m.fletcher@googlemail.com> | 2014-04-14 13:34:18 +0100 |
---|---|---|
committer | Colin Fletcher <colin.m.fletcher@googlemail.com> | 2014-05-07 19:38:07 +0100 |
commit | 9a35f73b9ead9b5930a7532466685b36ff2429d1 (patch) | |
tree | b703cbe0207d1a34ed787677168113370dce36ec /gtk2_ardour | |
parent | 56af57d682f696b531de331704875101127d66a0 (diff) |
Fix undo of layer-changing region drags
Move clear_changes() of the playlist on which a region has been dragged
before calling set_layer() on that playlist, so that undo of region drags
in layered mode undoes any layer changes too.
Should fix #5904
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 9d2f6065e0..057a3e478a 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -1077,6 +1077,17 @@ RegionMoveDrag::finished_no_copy ( } else { + boost::shared_ptr<Playlist> playlist = dest_rtv->playlist(); + + /* this movement may result in a crossfade being modified, or a layering change, + so we need to get undo data from the playlist as well as the region. + */ + + pair<PlaylistSet::iterator, bool> r = modified_playlists.insert (playlist); + if (r.second) { + playlist->clear_changes (); + } + rv->region()->clear_changes (); /* @@ -1090,30 +1101,18 @@ RegionMoveDrag::finished_no_copy ( rv->drag_end (); /* just change the model */ - - boost::shared_ptr<Playlist> playlist = dest_rtv->playlist(); - if (dest_rtv->view()->layer_display() == Stacked || dest_rtv->view()->layer_display() == Expanded) { playlist->set_layer (rv->region(), dest_layer); } /* freeze playlist to avoid lots of relayering in the case of a multi-region drag */ - pair<PlaylistSet::iterator, bool> r = frozen_playlists.insert (playlist); + r = frozen_playlists.insert (playlist); if (r.second) { playlist->freeze (); } - /* this movement may result in a crossfade being modified, so we need to get undo - data from the playlist as well as the region. - */ - - r = modified_playlists.insert (playlist); - if (r.second) { - playlist->clear_changes (); - } - rv->region()->set_position (where); _editor->session()->add_command (new StatefulDiffCommand (rv->region())); |