From eed79f45d72066690424198001f76b918461a643 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 25 Sep 2023 22:15:45 +0200 Subject: [PATCH] Fix layering when copy/pasting regions (2/2) --- gtk2_ardour/editor_ops.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 9b35fdec22..90980097b1 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -5092,6 +5092,7 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs) case Cut: _xx = RegionFactory::create (r, false); npl->add_region (_xx, timepos_t (first_position.distance (r->position()))); + npl->set_layer (_xx, r->layer ()); pl->remove_region (r); if (should_ripple()) { ripple_list.push_front (Ripple (pl, r->position(), -r->length())); @@ -5100,7 +5101,9 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs) case Copy: /* copy region before adding, so we're not putting same object into two different playlists */ - npl->add_region (RegionFactory::create (r, false), timepos_t (first_position.distance (r->position()))); + _xx = RegionFactory::create (r, false); + npl->add_region (_xx, timepos_t (first_position.distance (r->position()))); + npl->set_layer (_xx, r->layer ()); break; case Clear: