Skip to content

Commit

Permalink
Single Frame MovieClip adjust
Browse files Browse the repository at this point in the history
From #1048 - "I checked the FPS on LG TV and so it is done from 60 to 20. On a static image. After research, I found that in the advance method in MovieClip class there is a constant check to update the frame. I added a change to check if the MovieClip class total frame is equal to 1 to change it the mode of the MovieClip to a single frame. This increases performance back to 60 FPS." - LiorZar

Has been tested but keep an eye on it - @gskinner might want to double check it.
  • Loading branch information
danzen committed Mar 27, 2021
1 parent 9cb3b4b commit 4e63574
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/easeljs/display/MovieClip.js
Expand Up @@ -509,6 +509,9 @@ this.createjs = this.createjs||{};
while ((o = o.parent) && fps === null) { if (o.mode === independent) { fps = o._framerate; } }
this._framerate = fps;

// adjusted by Dan Zen 3/27/21 for https://github.com/CreateJS/EaselJS/issues/1048
if (this.totalFrames <= 1) { return; }

// calculate how many frames to advance:
var t = (fps !== null && fps !== -1 && time !== null) ? time/(1000/fps) + this._t : 1;
var frames = t|0;
Expand Down

0 comments on commit 4e63574

Please sign in to comment.