From c58d052a8e03e012cee93ea2b4e8bc38ab0a893b Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 28 Oct 2022 14:34:34 -0600 Subject: [PATCH] fix position of duplicated regions Several thinkos here but the most important one is that timepos_t::increment() returns a value, rather than modifying the object --- gtk2_ardour/editor_ops.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 6102f37b51..69110df7d3 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -5266,8 +5266,11 @@ Editor::duplicate_some_regions (RegionSelection& regions, float times) latest_regionviews.clear (); sigc::connection c = rtv->view()->RegionViewAdded.connect (sigc::mem_fun(*this, &Editor::collect_new_region_view)); - timepos_t position = end_time + (start_time.distance (r->position())); - position.increment (); + /* end time is an inclusive end; we need to place the + * duplicated region after that. + */ + + timepos_t position = end_time.increment(); playlist = (*i)->region()->playlist();