allow a drag down over the drop zone to be "reversed" and the region moved back up into existing tracks

This commit is contained in:
Paul Davis 2014-06-09 10:55:37 -04:00
parent 91702c2702
commit 0ca808f222

View file

@ -771,14 +771,20 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move)
if (tv) { if (tv) {
int track_index = i->time_axis_view + delta_time_axis_view; int track_index;
if (i->time_axis_view >= 0) {
track_index = i->time_axis_view + delta_time_axis_view;
} else {
track_index = _time_axis_views.size() - 1 + delta_time_axis_view;
}
if (track_index < 0 || track_index >= (int) _time_axis_views.size()) { if (track_index < 0 || track_index >= (int) _time_axis_views.size()) {
continue; continue;
} }
/* The TimeAxisView that this region is now over */ /* The TimeAxisView that this region is now over */
TimeAxisView* current_tv = _time_axis_views[i->time_axis_view + delta_time_axis_view]; TimeAxisView* current_tv = _time_axis_views[track_index];
/* Ensure it is moved from stacked -> expanded if appropriate */ /* Ensure it is moved from stacked -> expanded if appropriate */
if (current_tv->view()->layer_display() == Stacked) { if (current_tv->view()->layer_display() == Stacked) {
@ -803,7 +809,7 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move)
} }
/* Update the DraggingView */ /* Update the DraggingView */
i->time_axis_view += delta_time_axis_view; i->time_axis_view = track_index;
i->layer += this_delta_layer; i->layer += this_delta_layer;
if (_brushing) { if (_brushing) {