Prevent duplicate moves when selecting regions on shared playlists
selecting regions on multiple tracks which share playlists and dragging them has various odd side-effects. This prevents the worst of such edge-cases. A cleaner solution would be to not allow selecting the same region on multiple tracks at the same time in the first place. Comments are welcome.
This commit is contained in:
parent
8d70b76059
commit
01747f54d8
@ -1529,6 +1529,7 @@ RegionMoveDrag::finished_no_copy (
|
|||||||
typedef map<boost::shared_ptr<Playlist>, RouteTimeAxisView*> PlaylistMapping;
|
typedef map<boost::shared_ptr<Playlist>, RouteTimeAxisView*> PlaylistMapping;
|
||||||
PlaylistMapping playlist_mapping;
|
PlaylistMapping playlist_mapping;
|
||||||
|
|
||||||
|
std::set<boost::shared_ptr<const Region> > uniq;
|
||||||
for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ) {
|
for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ) {
|
||||||
|
|
||||||
RegionView* rv = i->view;
|
RegionView* rv = i->view;
|
||||||
@ -1539,6 +1540,13 @@ RegionMoveDrag::finished_no_copy (
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (uniq.find (rv->region()) != uniq.end()) {
|
||||||
|
/* prevent duplicate moves when selecting regions from shared playlists */
|
||||||
|
++i;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
uniq.insert(rv->region());
|
||||||
|
|
||||||
if (i->time_axis_view < 0 || i->time_axis_view >= (int)_time_axis_views.size()) {
|
if (i->time_axis_view < 0 || i->time_axis_view >= (int)_time_axis_views.size()) {
|
||||||
/* dragged to drop zone */
|
/* dragged to drop zone */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user