mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 07:04:31 +00:00
Calling getTextBounds
on a BitmapText object would return the incorrect values if the origin had been changed, but the text itself had not, as it was using out of date dimensions. Changing the origin now automatically triggers BitmapText to be dirty, forcing the bounds to be refreshed. Fix #5121
This commit is contained in:
parent
64c58bc592
commit
40929a57e3
1 changed files with 19 additions and 0 deletions
|
@ -382,6 +382,25 @@ var BitmapText = new Class({
|
|||
return bounds;
|
||||
},
|
||||
|
||||
/**
|
||||
* Updates the Display Origin cached values internally stored on this Game Object.
|
||||
* You don't usually call this directly, but it is exposed for edge-cases where you may.
|
||||
*
|
||||
* @method Phaser.GameObjects.Components.Origin#updateDisplayOrigin
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return {this} This Game Object instance.
|
||||
*/
|
||||
updateDisplayOrigin: function ()
|
||||
{
|
||||
this._displayOriginX = this.originX * this.width;
|
||||
this._displayOriginY = this.originY * this.height;
|
||||
|
||||
this._dirty = true;
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Changes the font this BitmapText is using to render.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue