Skip to content

Commit b2d062b

Browse files
committed
LoaderPlugin.progress and the corresponding event now factor in both the list size and the inflight size when calculating the percentage complete. Fix phaserjs#3384
1 parent b6b03b8 commit b2d062b

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
* The TweenManager will now check the state of a tween before playing it. If not in a pending state it will be skipped. This allows you to stop a tween immediately after creating it and not have it play through once anyway. Fix #3405 (thanks @Twilrom)
3636
* The InputPlugin.processOverOutEvents method wasn't correctly working out the total of the number of objects interacted with, which caused input events to be disabled in Scenes further down the scene list if something was being dragged in an upper scene. Fix #3399 (thanks @Jerenaux)
3737
* The InputPlugin.processDragEvents wasn't always returning an integer.
38+
* LoaderPlugin.progress and the corresponding event now factor in both the list size and the inflight size when calculating the percentage complete. Fix #3384 (thanks @vinerz @rblopes @samme)
3839

3940
### Updates
4041

src/loader/LoaderPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ var LoaderPlugin = new Class({
388388
*/
389389
updateProgress: function ()
390390
{
391-
this.progress = 1 - (this.list.size / this.totalToLoad);
391+
this.progress = 1 - ((this.list.size + this.inflight.size) / this.totalToLoad);
392392

393393
this.emit('progress', this.progress);
394394
},

0 commit comments

Comments
 (0)