Phaser.Display.Canvas.CanvasPool.first now returns the available pool item instead of always returning null.
This commit is contained in:
Matt Chiasson 2018-04-07 17:51:51 -04:00 committed by GitHub
parent b7ae0295bc
commit 5f7d3fa4a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -126,13 +126,13 @@ var CanvasPool = function ()
{
if (canvasType === undefined) { canvasType = CONST.CANVAS; }
pool.forEach(function (container)
{
for (var i = 0, len = pool.length; i < len; i++) {
var container = pool[i];
if (!container.parent && container.type === canvasType)
{
return container;
}
});
};
return null;
};