Skip to content

Commit a942a03

Browse files
committed
Texture width is recalculated larger on subsequent call to updateText() when text has a stroke thickness > 1
In function override Phaser.Text.prototype.updateText(), don't include this.context.lineWidth in width calculation as it's already incorporated by this.style.strokeThickness.
1 parent 98e6f15 commit a942a03

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/gameobjects/Text.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ Phaser.Text.prototype.updateText = function () {
379379

380380
var width = maxLineWidth + this.style.strokeThickness;
381381

382-
this.canvas.width = (width + this.context.lineWidth) * this.resolution;
382+
this.canvas.width = width * this.resolution;
383383

384384
//calculate text height
385385
var lineHeight = fontProperties.fontSize + this.style.strokeThickness;

0 commit comments

Comments
 (0)