bug on Repeat when diff bigger than duration

This commit is contained in:
yangxiao 2014-06-16 18:21:47 +08:00
parent bc31d6b082
commit 927d29f334
1 changed files with 2 additions and 0 deletions

View File

@ -528,6 +528,8 @@ void RepeatForever::step(float dt)
if (_innerAction->isDone())
{
float diff = _innerAction->getElapsed() - _innerAction->getDuration();
if (diff > _innerAction->getDuration())
diff = fmodf(diff, _innerAction->getDuration());
_innerAction->startWithTarget(_target);
// to prevent jerk. issue #390, 1247
_innerAction->step(0.0f);