diff --git a/src/extras/BitmapText.js b/src/extras/BitmapText.js index d8fbd7d..ed33434 100644 --- a/src/extras/BitmapText.js +++ b/src/extras/BitmapText.js @@ -344,13 +344,34 @@ */ BitmapText.prototype.updateTransform = function () { + this.validate(); + this.containerUpdateTransform(); +}; + +/** + * Validates text before calling parent's getLocalBounds + * + * @return {Rectangle} The rectangular bounding area + */ + +BitmapText.prototype.getLocalBounds = function() +{ + this.validate(); + return core.Container.prototype.getLocalBounds.call(this); +}; + +/** + * Updates text when needed + * + * @private + */ +BitmapText.prototype.validate = function() +{ if (this.dirty) { this.updateText(); this.dirty = false; } - - this.containerUpdateTransform(); }; BitmapText.fonts = {};