From 55953078d0febc8154ce089e7b16e7cb046f3f98 Mon Sep 17 00:00:00 2001 From: photonstorm Date: Sat, 8 Nov 2014 17:08:29 +0000 Subject: [PATCH] FrameData.clone fixed when cloning data using frame names rather than indexes (thanks pjbaron) --- README.md | 2 ++ src/animation/FrameData.js | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dff02a0ea..0da41f8e8 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/animation/FrameData.js b/src/animation/FrameData.js index e42b094fc..36e4b0d08 100644 --- a/src/animation/FrameData.js +++ b/src/animation/FrameData.js @@ -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;