AutomatableModel: use nearbyintf() for rounding

For some reason roundf() causes an exception on Win32 when calling with
negative values. This caused LMMS to crash when turning an external MIDI
pitch wheel downwards.

Closes #281.
This commit is contained in:
Tobias Doerffel
2014-02-13 01:14:06 +01:00
parent f329bccb6b
commit cdb8197c5d

View File

@@ -280,7 +280,7 @@ float AutomatableModel::fittedValue( float value ) const
if( m_step != 0 )
{
value = roundf( value / m_step ) * m_step;
value = nearbyintf( value / m_step ) * m_step;
}
// correct rounding error at the border