mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
Fix macro usage in cc.delayTime
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user