# HG changeset patch # User Chris Cannam # Date 1228149917 0 # Node ID 747a58d45d56a576b8b9a403a960b30d753722cb # Parent e2a40fdadd8c4ad2e142f7b8599bbcd15d55a4b4 * Fix incorrect starting extents in derived note & time-value layers (happening when top==bottom==0 and thus recalculated from model extents before model is complete) diff -r e2a40fdadd8c -r 747a58d45d56 layer/NoteLayer.cpp --- a/layer/NoteLayer.cpp Fri Nov 28 13:36:13 2008 +0000 +++ b/layer/NoteLayer.cpp Mon Dec 01 16:45:17 2008 +0000 @@ -223,13 +223,13 @@ } if (m_scaleMinimum == m_scaleMaximum) { - m_scaleMinimum = m_model->getValueMinimum(); - m_scaleMaximum = m_model->getValueMaximum(); + min = m_model->getValueMinimum(); + max = m_model->getValueMaximum(); + } else { + min = m_scaleMinimum; + max = m_scaleMaximum; } - min = m_scaleMinimum; - max = m_scaleMaximum; - if (shouldConvertMIDIToHz()) { min = Pitch::getFrequencyForPitch(lrintf(min)); max = Pitch::getFrequencyForPitch(lrintf(max + 1)); diff -r e2a40fdadd8c -r 747a58d45d56 layer/TimeValueLayer.cpp --- a/layer/TimeValueLayer.cpp Fri Nov 28 13:36:13 2008 +0000 +++ b/layer/TimeValueLayer.cpp Mon Dec 01 16:45:17 2008 +0000 @@ -267,8 +267,9 @@ if (!m_model || shouldAutoAlign()) return false; if (m_scaleMinimum == m_scaleMaximum) { - m_scaleMinimum = m_model->getValueMinimum(); - m_scaleMaximum = m_model->getValueMaximum(); + min = m_model->getValueMinimum(); + max = m_model->getValueMaximum(); + return true; } min = m_scaleMinimum;