Skip to content

Commit b2fe49f

Browse files
author
Andrew Start
committed
Fixed floating point errors throwing off frame calculations.
1 parent e0e423e commit b2fe49f

7 files changed

Lines changed: 12 additions & 10 deletions

File tree

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "EaselJS",
3-
"version": "0.8.4",
3+
"version": "0.8.5",
44
"homepage": "https://github.com/CreateJS/EaselJS",
55
"authors": [
66
"gskinner",

build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "EaselJS",
3-
"version": "0.8.4",
3+
"version": "0.8.5",
44
"description": "EaselJS Docs",
55
"url": "http://www.createjs.com/#!/EaselJS",
66
"logo": "assets/docs-icon-EaselJS.png",

lib/easeljs.combined.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13149,14 +13149,14 @@ this.createjs = this.createjs || {};
1314913149
* @type String
1315013150
* @static
1315113151
**/
13152-
s.version = /*=version*/"0.8.4"; // injected by build process
13152+
s.version = /*=version*/"0.8.5"; // injected by build process
1315313153

1315413154
/**
1315513155
* The build date for this release in UTC format.
1315613156
* @property buildDate
1315713157
* @type String
1315813158
* @static
1315913159
**/
13160-
s.buildDate = /*=date*/"Thu, 19 Mar 2015 15:04:58 GMT"; // injected by build process
13160+
s.buildDate = /*=date*/"Fri, 08 May 2015 22:01:28 GMT"; // injected by build process
1316113161

1316213162
})();

lib/easeljs.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/movieclip.combined.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,8 @@ this.createjs = this.createjs||{};
499499
this._t += time * 0.001;//milliseconds -> seconds
500500
if(this._t > this._duration)
501501
this._t = this.timeline.loop ? this._t - this._duration : this._duration;
502-
this._prevPosition = Math.floor(this._t * this._framerate);
502+
//add a tiny amount to account for potential floating point errors
503+
this._prevPosition = Math.floor(this._t * this._framerate + 0.00000001);
503504
if(this._prevPosition > this.timeline.duration)
504505
this._prevPosition = this.timeline.duration;
505506
}
@@ -774,7 +775,7 @@ this.createjs = this.createjs || {};
774775
* @type String
775776
* @static
776777
**/
777-
s.version = /*=version*/"0.8.4"; // injected by build process
778+
s.version = /*=version*/"0.8.5"; // injected by build process
778779

779780
/**
780781
* The build date for this release in UTC format.
@@ -783,6 +784,6 @@ this.createjs = this.createjs || {};
783784
* @type String
784785
* @static
785786
**/
786-
s.buildDate = /*=date*/"Thu, 19 Mar 2015 15:04:58 GMT"; // injected by build process
787+
s.buildDate = /*=date*/"Fri, 08 May 2015 22:01:28 GMT"; // injected by build process
787788

788789
})();

lib/movieclip.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/easeljs/display/MovieClip.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,8 @@ this.createjs = this.createjs||{};
499499
this._t += time * 0.001;//milliseconds -> seconds
500500
if(this._t > this._duration)
501501
this._t = this.timeline.loop ? this._t - this._duration : this._duration;
502-
this._prevPosition = Math.floor(this._t * this._framerate);
502+
//add a tiny amount to account for potential floating point errors
503+
this._prevPosition = Math.floor(this._t * this._framerate + 0.00000001);
503504
if(this._prevPosition > this.timeline.duration)
504505
this._prevPosition = this.timeline.duration;
505506
}

0 commit comments

Comments
 (0)