Fix Note Quantization Resetting Clip Length (#8131)
Fixes an issue where quantizing notes in a midi clip with auto-resize disabled would cause the length to be reset, in cases where there is only a single note in the clip. This was due to how quantization removes and re-adds each note, so for a moment, the clip would be empty, thus treated as a beat clip. Beat clips were mistakenly always automatically resized no matter whether auto-resize was enabled or not. This PR fixes that by only auto-resizing beat clips when they have auto-resize enabled. Co-authored-by: Fawn <rubiefawn@gmail.com> --------- Co-authored-by: Fawn <rubiefawn@gmail.com>
This commit is contained in:
@@ -125,16 +125,15 @@ void MidiClip::init()
|
||||
|
||||
void MidiClip::updateLength()
|
||||
{
|
||||
if( m_clipType == Type::BeatClip )
|
||||
{
|
||||
changeLength( beatClipLength() );
|
||||
updatePatternTrack();
|
||||
return;
|
||||
}
|
||||
|
||||
// If the clip hasn't already been manually resized, automatically resize it.
|
||||
if (getAutoResize())
|
||||
{
|
||||
if (m_clipType == Type::BeatClip)
|
||||
{
|
||||
changeLength(beatClipLength());
|
||||
updatePatternTrack();
|
||||
return;
|
||||
}
|
||||
tick_t max_length = TimePos::ticksPerBar();
|
||||
|
||||
for (const auto& note : m_notes)
|
||||
|
||||
Reference in New Issue
Block a user