mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-20 22:30:05 +02:00
Cut then paste has no net effect on envelope in some more cases...
... whereas before, some incorrect disconituities could remain near the start of the selection. To find reproducible cases before this commit might involve varying the left edge of the selection by small amounts, because this problem depended on little roundoff errors.
This commit is contained in:
parent
6373a5085c
commit
bbab89b52c
@ -717,7 +717,13 @@ void Envelope::CollapseRegion( double t0, double t1, double sampleDur )
|
|||||||
auto len = mEnv.size();
|
auto len = mEnv.size();
|
||||||
for ( size_t i = begin; i < len; ++i ) {
|
for ( size_t i = begin; i < len; ++i ) {
|
||||||
auto &point = mEnv[i];
|
auto &point = mEnv[i];
|
||||||
point.SetT( point.GetT() - (t1 - t0) );
|
if (rightPoint && i == begin)
|
||||||
|
// Avoid roundoff error.
|
||||||
|
// Make exactly equal times of neighboring points so that we have
|
||||||
|
// a real discontinuity.
|
||||||
|
point.SetT( t0 );
|
||||||
|
else
|
||||||
|
point.SetT( point.GetT() - (t1 - t0) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// See if the discontinuity is removable.
|
// See if the discontinuity is removable.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user