From 97e4a4f04a57d40bd2c134d3217d2aeba1a3c82c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 13 Mar 2021 18:56:14 -0700 Subject: [PATCH] change semantics of Region::set_length() to preserve current position Before the nutempo changes, a call to Region::set_length() only set the length of the region. Now that Region::_length is a duple of (duration,position), maintain thesame semantics so that the call only affects the duration part of the duple. Theoretically we might at some point want/need Region::set_length_and_position() but that is not the case at this point, --- libs/ardour/region.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index ce2156ead6..0008617bfd 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -491,8 +491,12 @@ Region::set_length (timecnt_t const & len) void Region::set_length_internal (timecnt_t const & len) { - _last_length = _length; - _length = len; + timecnt_t l (len); + + l.set_position (position()); + + _last_length = l; + _length = l; } void