Skip to content

Commit 5f7d3fa

Browse files
closes phaserjs#3520
Phaser.Display.Canvas.CanvasPool.first now returns the available pool item instead of always returning null.
1 parent b7ae029 commit 5f7d3fa

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/display/canvas/CanvasPool.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ var CanvasPool = function ()
126126
{
127127
if (canvasType === undefined) { canvasType = CONST.CANVAS; }
128128

129-
pool.forEach(function (container)
130-
{
129+
for (var i = 0, len = pool.length; i < len; i++) {
130+
var container = pool[i];
131131
if (!container.parent && container.type === canvasType)
132132
{
133133
return container;
134134
}
135-
});
135+
};
136136

137137
return null;
138138
};

0 commit comments

Comments
 (0)