Mercurial > hg > svgui
changeset 455:747a58d45d56
* 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)
author | Chris Cannam |
---|---|
date | Mon, 01 Dec 2008 16:45:17 +0000 |
parents | e2a40fdadd8c |
children | 035d62c4cddf |
files | layer/NoteLayer.cpp layer/TimeValueLayer.cpp |
diffstat | 2 files changed, 8 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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));
--- 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;