13
0

Fix some problems with dragging more than 1 region to a new track.

git-svn-id: svn://localhost/ardour2/branches/3.0@4530 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2009-02-11 17:20:46 +00:00
parent 947077c12e
commit 41afd1201d

View File

@ -4235,6 +4235,7 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
nframes64_t drag_delta; nframes64_t drag_delta;
bool changed_tracks, changed_position; bool changed_tracks, changed_position;
std::pair<TimeAxisView*, int> tvp; std::pair<TimeAxisView*, int> tvp;
std::map<RegionView*, RouteTimeAxisView*> final;
/* first_move is set to false if the regionview has been moved in the /* first_move is set to false if the regionview has been moved in the
motion handler. motion handler.
@ -4297,16 +4298,22 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
track_canvas->update_now (); track_canvas->update_now ();
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ) { /* make a list of where each region ended up */
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ++i) {
RegionView* rv = (*i);
double ix1, ix2, iy1, iy2; double ix1, ix2, iy1, iy2;
rv->get_canvas_frame()->get_bounds (ix1, iy1, ix2, iy2); (*i)->get_canvas_frame()->get_bounds (ix1, iy1, ix2, iy2);
rv->get_canvas_frame()->i2w (ix1, iy1); (*i)->get_canvas_frame()->i2w (ix1, iy1);
iy1 += vertical_adjustment.get_value() - canvas_timebars_vsize; iy1 += vertical_adjustment.get_value() - canvas_timebars_vsize;
std::pair<TimeAxisView*, int> const dest_tv = trackview_by_y_position (iy1); std::pair<TimeAxisView*, int> tv = trackview_by_y_position (iy1);
RouteTimeAxisView* dest_rtv = dynamic_cast<RouteTimeAxisView*> (dest_tv.first); final[*i] = dynamic_cast<RouteTimeAxisView*> (tv.first);
}
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ) {
RegionView* rv = (*i);
RouteTimeAxisView* dest_rtv = final[*i];
nframes64_t where; nframes64_t where;