13
0

fix drop-zone drops

There is no special ‘-1’ indicator any more.
i->time_axis_view is unbound to allow relative
positioning when dragging multiple regions.
This commit is contained in:
Robin Gareus 2015-03-25 12:11:49 +01:00
parent b34f26a7d0
commit 6cfb6ef665

View File

@ -1413,7 +1413,7 @@ RegionMoveDrag::finished_no_copy (
continue; continue;
} }
if (i->time_axis_view < 0) { if (i->time_axis_view < 0 || i->time_axis_view >= _time_axis_views.size()) {
/* dragged to drop zone */ /* dragged to drop zone */
PlaylistMapping::iterator pm; PlaylistMapping::iterator pm;
@ -1759,7 +1759,10 @@ RegionInsertDrag::RegionInsertDrag (Editor* e, boost::shared_ptr<Region> r, Rout
void void
RegionInsertDrag::finished (GdkEvent *, bool) RegionInsertDrag::finished (GdkEvent *, bool)
{ {
RouteTimeAxisView* dest_rtv = dynamic_cast<RouteTimeAxisView*> (_time_axis_views[_views.front().time_axis_view]); int pos = _views.front().time_axis_view;
assert(pos >= 0 && pos < _time_axis_views.size());
RouteTimeAxisView* dest_rtv = dynamic_cast<RouteTimeAxisView*> (_time_axis_views[pos]);
_primary->get_canvas_group()->reparent (dest_rtv->view()->canvas_item()); _primary->get_canvas_group()->reparent (dest_rtv->view()->canvas_item());
_primary->get_canvas_group()->set_y_position (0); _primary->get_canvas_group()->set_y_position (0);