Work-around/Fix DnD from sidebar to editor-canvas

Editor::drop_regions() creates a new RegionInsertDrag()
with the region to drop to the timeline.

RegionInsertDrag is-a RegionMotionDrag is-a RegionDrag is-a Drag.
However the region does not yet exist on the timeline and
RegionView is NULL.

This will likely need an API change. e.g.
Directly pass the TimeDomain as argument. The information can
be provided by the region, or from the TimeAxisView or RouteUI
when dropping a new source/region.
This commit is contained in:
Robin Gareus 2022-01-10 21:36:17 +01:00
parent 056189c76c
commit fa7e7a462c
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 1 additions and 1 deletions

View File

@ -601,7 +601,7 @@ struct TimeAxisViewStripableSorter {
};
RegionDrag::RegionDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list<RegionView*> const & v)
: Drag (e, i, p->region()->position().time_domain())
: Drag (e, i, p && p->region () ? p->region()->position().time_domain() : Temporal::AudioTime)
, _primary (p)
, _ntracks (0)
{