From e6fb2f8924e34edbfa45145e750ab147621597a4 Mon Sep 17 00:00:00 2001 From: geron-cn Date: Wed, 16 Sep 2015 15:44:43 +0800 Subject: [PATCH] fix ReEntry a same frame when scale action's speed. --- .../cocostudio/ActionTimeline/CCActionTimeline.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp index ef24266dc8..e8912dfd67 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp @@ -197,10 +197,12 @@ void ActionTimeline::step(float delta) { return; } - _time += delta * _timeSpeed; - const float endtoffset = _time - _endFrame * _frameInternal; + float deltaCurrFrameTime = abs(_time - _currentFrame * _frameInternal); + if (deltaCurrFrameTime < _frameInternal) + return; + const float endtoffset = _time - _endFrame * _frameInternal; if (endtoffset < _frameInternal) { _currentFrame = (int)(_time / _frameInternal);