Skip to content

Commit 5cc6b59

Browse files
committed
Add missing assignations required for wrapping calculations to work
correctly
1 parent ef7c2c6 commit 5cc6b59

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/gameobjects/Text.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,8 @@ Phaser.Text.prototype.addFontWeight = function (weight, position) {
815815
* @return {array} An array of strings with the pieces of wrapped text.
816816
*/
817817
Phaser.Text.prototype.precalculateWordWrap = function (text) {
818+
this.texture.baseTexture.resolution = this._res;
819+
this.context.font = this.style.font;
818820
var wrappedLines = this.runWordWrap(text);
819821
return wrappedLines.split(/(?:\r\n|\r|\n)/);
820822
};

0 commit comments

Comments
 (0)