From e2a2eef60ab7d9bfea491ff1e7aeb819c97f3323 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Mon, 28 Mar 2016 19:57:53 +0800 Subject: [PATCH] Fix macro usage in cc.delayTime --- cocos2d/actions/CCActionInterval.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2d/actions/CCActionInterval.js b/cocos2d/actions/CCActionInterval.js index 1fbcf94d2a..3fb7d14d35 100644 --- a/cocos2d/actions/CCActionInterval.js +++ b/cocos2d/actions/CCActionInterval.js @@ -81,7 +81,7 @@ cc.ActionInterval = cc.FiniteTimeAction.extend({ * @return {Boolean} */ initWithDuration:function (d) { - this._duration = (d === 0) ? cc.FLT_EPSILON : d; + this._duration = (d === 0) ? cc.macro.FLT_EPSILON : d; // prevent division by 0 // This comparison could be in step:, but it might decrease the performance // by 3% in heavy based action games. @@ -156,7 +156,7 @@ cc.ActionInterval = cc.FiniteTimeAction.extend({ this._elapsed += dt; //this.update((1 > (this._elapsed / this._duration)) ? this._elapsed / this._duration : 1); - //this.update(Math.max(0, Math.min(1, this._elapsed / Math.max(this._duration, cc.FLT_EPSILON)))); + //this.update(Math.max(0, Math.min(1, this._elapsed / Math.max(this._duration, cc.macro.FLT_EPSILON)))); var t = this._elapsed / (this._duration > 0.0000001192092896 ? this._duration : 0.0000001192092896); t = (1 > t ? t : 1); this.update(t > 0 ? t : 0);