Skip to content

Commit

Permalink
Remove call to Clip::changeLength
Browse files Browse the repository at this point in the history
Remove the call to `Clip::changeLength` from
`TrackContentWidget::changePosition` as it results in bad performance,
especially when the Song Editor is in auto-scroll mode and the position
is changed very often.

The call in question has set the clip to the length that it already has
which in turn resulted in lots of needless calls to `Song::updateLength`.

It also should not be necessary to update a clip length if all that we
do is change the position of the `TrackContentWidget`.
  • Loading branch information
michaelgregorius committed Nov 3, 2024
1 parent 07baf9e commit 5626a51
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/gui/tracks/TrackContentWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,6 @@ void TrackContentWidget::changePosition( const TimePos & newPos )
{
Clip* clip = clipView->getClip();

clip->changeLength( clip->length() );

const int ts = clip->startPosition();
const int te = clip->endPosition()-3;
if( ( ts >= begin && ts <= end ) ||
Expand Down

0 comments on commit 5626a51

Please sign in to comment.