diff options
author | Robin Gareus <robin@gareus.org> | 2015-03-25 22:05:23 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-03-25 22:06:05 +0100 |
commit | 7b1d21128b4819c480d04859b9df47e5ee41a264 (patch) | |
tree | 24dae78de34c6903f2c9aec05a0f9d88475095a1 /gtk2_ardour | |
parent | 07997a6d38625aea7028cc797d5d3b3246650cfa (diff) |
fix dropzone region ordering
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 470a57ade2..f2bb65b695 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -756,6 +756,12 @@ RegionMotionDrag::y_movement_allowed (int delta_track, double delta_layer, int s return true; } +struct DraggingViewSorter { + bool operator() (const DraggingView& a, const DraggingView& b) { + return a.time_axis_view < b.time_axis_view; + } +}; + void RegionMotionDrag::motion (GdkEvent* event, bool first_move) { @@ -940,6 +946,14 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move) } } + if (first_move) { + /* sort views by time_axis. + * This retains track order in the dropzone, regardless + * of actual selection order + */ + _views.sort (DraggingViewSorter()); + } + for (list<DraggingView>::iterator i = _views.begin(); i != _views.end(); ++i) { RegionView* rv = i->view; |