stop animation, when start/endValues are chaged. Otherwise we will run
into crashes, when value types have not been aligned or can't be aligned
This commit is contained in:
parent
81cf9a20ee
commit
b1931d43b9
@ -112,11 +112,13 @@ QskVariantAnimator::~QskVariantAnimator()
|
||||
|
||||
void QskVariantAnimator::setStartValue( const QVariant& value )
|
||||
{
|
||||
stop();
|
||||
m_startValue = value;
|
||||
}
|
||||
|
||||
void QskVariantAnimator::setEndValue( const QVariant& value )
|
||||
{
|
||||
stop();
|
||||
m_endValue = value;
|
||||
}
|
||||
|
||||
@ -191,6 +193,8 @@ void QskVariantAnimator::advance( qreal progress )
|
||||
if ( qFuzzyCompare( progress, 1.0 ) )
|
||||
progress = 1.0;
|
||||
|
||||
Q_ASSERT( qskMetaType( m_startValue ) == qskMetaType( m_endValue ) );
|
||||
|
||||
m_currentValue = qskInterpolate( m_interpolator,
|
||||
m_startValue, m_endValue, progress );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user