From f14cb687defb528aac8aa8e5ff324316a5d340ed Mon Sep 17 00:00:00 2001 From: Javier Serrano Polo Date: Tue, 30 Aug 2016 17:45:09 +0000 Subject: [PATCH] Drop forceStep in AutomatableModel (#3010) --- include/AutomatableModel.h | 2 +- src/core/AutomatableModel.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/AutomatableModel.h b/include/AutomatableModel.h index 9f53c9451..acefc95c3 100644 --- a/include/AutomatableModel.h +++ b/include/AutomatableModel.h @@ -297,7 +297,7 @@ protected: //! max() and aligned according to the step size (step size 0.05 -> value //! 0.12345 becomes 0.10 etc.). You should always call it at the end after //! doing your own calculations. - float fittedValue( float value, bool forceStep = false ) const; + float fittedValue( float value ) const; private: diff --git a/src/core/AutomatableModel.cpp b/src/core/AutomatableModel.cpp index 987beed3e..509ee4aa0 100644 --- a/src/core/AutomatableModel.cpp +++ b/src/core/AutomatableModel.cpp @@ -377,11 +377,11 @@ void AutomatableModel::setStep( const float step ) -float AutomatableModel::fittedValue( float value, bool forceStep ) const +float AutomatableModel::fittedValue( float value ) const { value = tLimit( value, m_minValue, m_maxValue ); - if( m_step != 0 && ( m_hasStrictStepSize || forceStep ) ) + if( m_step != 0 && m_hasStrictStepSize ) { value = nearbyintf( value / m_step ) * m_step; } @@ -583,7 +583,7 @@ ValueBuffer * AutomatableModel::valueBuffer() float * nvalues = m_valueBuffer.values(); for( int i = 0; i < vb->length(); i++ ) { - nvalues[i] = fittedValue( values[i], false ); + nvalues[i] = fittedValue( values[i] ); } m_lastUpdatedPeriod = s_periodCounter; m_hasSampleExactData = true;