fix dropzone region ordering

This commit is contained in:
Robin Gareus 2015-03-25 22:05:23 +01:00
parent 07997a6d38
commit 7b1d21128b

View File

@ -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;