Skip to content

Conversation

spayton
Copy link
Contributor

@spayton spayton commented Oct 28, 2014

...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.

The problem can be demonstrated as follows:

  1. Go to Phaser text stroke example with Phaser V2.1.2 (http://examples.phaser.io/_site/view_full.html?d=text&f=text%20stroke.js&t=text%20stroke&phaser_version=v2.1.2&)
  2. Open up browser dev console and type "text.updateText()" watch the text as you hit return
  3. Result, nothing, as expected
  4. Now go to same example with Phaser V2.1.3 (http://examples.phaser.io/_site/view_full.html?d=text&f=text%20stroke.js&t=text%20stroke&phaser_version=v2.1.3&)
  5. Repeat step 2
  6. Result, the text jumps left a few pixels

…() 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.
photonstorm added a commit that referenced this pull request Oct 28, 2014
Texture width is recalculated larger on subsequent call to updateText() ...
@photonstorm photonstorm merged commit cee5e2a into phaserjs:dev Oct 28, 2014
@photonstorm
Copy link
Collaborator

👍 nice one

photonstorm added a commit that referenced this pull request Oct 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants