Skip to content

Commit

Permalink
Merge pull request #2685 from valent-novem/dev
Browse files Browse the repository at this point in the history
Fix rendering text with bounds and resolution
  • Loading branch information
photonstorm committed Aug 16, 2016
2 parents 435ff9a + 68fe8b8 commit a4de55c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gameobjects/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -1442,20 +1442,20 @@ Phaser.Text.prototype.updateTexture = function () {
// Align the canvas based on the bounds
if (this.style.boundsAlignH === 'right')
{
x += this.textBounds.width - this.canvas.width;
x += this.textBounds.width - this.canvas.width / this.resolution;
}
else if (this.style.boundsAlignH === 'center')
{
x += this.textBounds.halfWidth - (this.canvas.width / 2);
x += this.textBounds.halfWidth - (this.canvas.width / this.resolution / 2);
}

if (this.style.boundsAlignV === 'bottom')
{
y += this.textBounds.height - this.canvas.height;
y += this.textBounds.height - this.canvas.height / this.resolution;
}
else if (this.style.boundsAlignV === 'middle')
{
y += this.textBounds.halfHeight - (this.canvas.height / 2);
y += this.textBounds.halfHeight - (this.canvas.height / this.resolution / 2);
}

this.pivot.x = -x;
Expand Down

0 comments on commit a4de55c

Please sign in to comment.