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:
regulus79
2025-11-23 12:34:41 -05:00
committed by GitHub
parent eb41051bc5
commit f093bde60c

View File

@@ -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)