From 9c7cebc9e1ae3e39c09a34aa074d40037c4af49a Mon Sep 17 00:00:00 2001 From: 2youyouo2 <501251991@qq.com> Date: Mon, 21 Dec 2015 20:22:22 +0800 Subject: [PATCH] fixed may add last ratio twice --- cocos2d/animation/motion-path-helper.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cocos2d/animation/motion-path-helper.js b/cocos2d/animation/motion-path-helper.js index 9196b340af..28c9553d7c 100644 --- a/cocos2d/animation/motion-path-helper.js +++ b/cocos2d/animation/motion-path-helper.js @@ -319,7 +319,9 @@ function sampleMotionPaths (motionPaths, data, duration, fps) { startRatioOffset = 0; } - addNewDatas(values[values.length - 1], DynamicAnimCurve.Linear, ratios[ratios.length - 1]); + if (ratios[ratios.length - 1] !== newRatios[newRatios.length -1]) { + addNewDatas(values[values.length - 1], DynamicAnimCurve.Linear, ratios[ratios.length - 1]); + } } if (CC_TEST) {