Replace static var by property, see "Add magnetic effect..." commit

This commit is contained in:
NoiseByNorthwest
2012-01-26 00:38:46 +01:00
committed by Tobias Doerffel
parent b3b290f6dd
commit 132ab41e5d
2 changed files with 5 additions and 4 deletions

View File

@@ -151,6 +151,8 @@ private:
QPoint m_origMousePos;
bool m_buttonPressed;
int m_magneticDecay;
float m_totalAngle;
int m_angle;
QImage m_cache;

View File

@@ -63,6 +63,7 @@ knob::knob( int _knob_num, QWidget * _parent, const QString & _name ) :
m_volumeKnob( false ),
m_mouseOffset( 0.0f ),
m_buttonPressed( false ),
m_magneticDecay( 0 ),
m_angle( -10 ),
m_outerColor( NULL )
{
@@ -563,11 +564,9 @@ void knob::setPosition( const QPoint & _p )
if( model()->initValue() == current )
{
// not critical but should be a property
static int magnet_dec = 0;
if( ++magnet_dec > 20 )
if( ++m_magneticDecay > 20 )
{
magnet_dec = 0;
m_magneticDecay = 0;
model()->setValue( next );
}