FrameData.clone fixed when cloning data using frame names rather than indexes (thanks pjbaron)

This commit is contained in:
photonstorm 2014-11-08 17:08:29 +00:00
parent 6d8fb60f77
commit 55953078d0
2 changed files with 7 additions and 2 deletions

View file

@ -92,6 +92,7 @@ Version 2.1.4 - "Bethal" - in development
* ScaleManager.viewportHeight returns the viewport height in pixels.
* ScaleManager.documentWidth returns the document width in pixels.
* ScaleManager.documentHeight returns the document height in pixels.
* TilemapLayers have been given a decent performance boost on canvas with map shifting edge-redraw (thanks @pnstickne #1250)
### Updates
@ -139,6 +140,7 @@ Version 2.1.4 - "Bethal" - in development
* Fullscreen mode in IE11 now works (thanks @pnstickne)
* Cache.addBitmapData now auto-creates a FrameData (thanks @pnstickne #1294 #1300)
* P2.BodyDebug circles were drawing at half widths (thanks @enriqueto #1288)
* FrameData.clone fixed when cloning data using frame names rather than indexes (thanks pjbaron)
For details about changes made in previous versions of Phaser see the full Change Log at https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md

View file

@ -121,9 +121,12 @@ Phaser.FrameData.prototype = {
output._frames.push(this._frames[i].clone());
}
for (var i = 0; i < this._frameNames.length; i++)
for (var p in this._frameNames)
{
output._frameNames.push(this._frameNames[i]);
if (this._frameNames.hasOwnProperty(p))
{
output._frameNames.push(this._frameNames[p]);
}
}
return output;