Skip to content

Commit 5893224

Browse files
committed
The Style object passed in to Phaser.Text is now cloned instead of referenced. This means you can adjust single Text instances without invaliding other Text objects using the same style object (thanks @asyncanup phaserjs#2267)
1 parent 34aff35 commit 5893224

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ If you are an exceptional JavaScript developer and would like to join the Phaser
285285
* BitmapData.setHSL now accepts 0 as a valid parameter (thanks @FracturedShader #2209)
286286
* Force the usage of typescript 1.4.1 in the package.json so that the TypeScript defs with comments is rebuilt properly again (thanks @vulvulune #2198)
287287
* A tiny logic update in the StateManager (thanks @jaminscript #2151)
288+
* The Style object passed in to Phaser.Text is now cloned instead of referenced. This means you can adjust single Text instances without invaliding other Text objects using the same style object (thanks @asyncanup #2267)
288289

289290
### Bug Fixes
290291

src/gameobjects/Text.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Phaser.Text = function (game, x, y, text, style) {
5050
text = text.toString();
5151
}
5252

53-
style = style || {};
53+
style = Phaser.Utils.extend({}, style);
5454

5555
/**
5656
* @property {number} type - The const type of this object.

0 commit comments

Comments
 (0)