Skip to content

Commit e4595d2

Browse files
committed
Fix box dimensions in PIXI.BitmapText. Support anchor in Phaser.BitmapText
1 parent 8452fa0 commit e4595d2

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/gameobjects/BitmapText.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ Phaser.BitmapText.prototype.update = function() {
8080
this._cache.dirty = true;
8181
}
8282

83+
this.pivot.x = this.anchor.x*this.width;
84+
this.pivot.y = this.anchor.y*this.height;
85+
8386
}
8487

8588
Object.defineProperty(Phaser.BitmapText.prototype, 'angle', {

src/pixi/text/BitmapText.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ PIXI.BitmapText.prototype.updateText = function()
135135
this.addChild(c);
136136
}
137137

138-
this.width = pos.x * scale;
138+
this.width = maxLineWidth * scale;
139139
this.height = (pos.y + data.lineHeight) * scale;
140140
};
141141

0 commit comments

Comments
 (0)