Skip to content

Commit 08eaaec

Browse files
committed
Add additional letterSpacing checks in Text
Was missing in width calculations for other line types
1 parent 19c6bb4 commit 08eaaec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/gameobjects/Text.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ Phaser.Text.prototype.updateText = function ()
472472
{
473473
var section = 0;
474474

475-
if (this.colors.length > 0 || this.strokeColors.length > 0 || this.fontWeights.length > 0 || this.fontStyles.length > 0)
475+
if (this.colors.length > 0 || this.strokeColors.length > 0 || this.fontWeights.length > 0 || this.fontStyles.length > 0 || this.letterSpacing !== '0px')
476476
{
477477
section = this.measureLine(line[c]);
478478
}
@@ -494,7 +494,7 @@ Phaser.Text.prototype.updateText = function ()
494494
for (var c = 0; c < line.length; c++)
495495
{
496496
// How far to the next tab?
497-
if (this.colors.length > 0 || this.strokeColors.length > 0 || this.fontWeights.length > 0 || this.fontStyles.length > 0)
497+
if (this.colors.length > 0 || this.strokeColors.length > 0 || this.fontWeights.length > 0 || this.fontStyles.length > 0 || this.letterSpacing !== '0px')
498498
{
499499
lineWidth += this.measureLine(line[c]);
500500
}
@@ -772,7 +772,7 @@ Phaser.Text.prototype.measureLine = function (line)
772772
this.updateShadow(this.style.shadowFill);
773773
}
774774

775-
if (this.letterSpacing)
775+
if (this.letterSpacing && this.letterSpacing !== '0px')
776776
{
777777
this.context.letterSpacing = this.letterSpacing;
778778
}

0 commit comments

Comments
 (0)