Кто-нибудь знает, есть ли способ найти высоту текста в классе TextLayout?Найти текстовую высоту компонента TextLayout
Я делаю свои объекты TextLayout так:
this._textFlow = new TextFlow();
this._paragraphElement = new ParagraphElement();
this._textFlow.addChild(this._paragraphElement);
this._span = new SpanElement();
this._span.text = this._text;
this._paragraphElement.addChild(this._span);
if(this._textAlign != ''){
this._paragraphElement.textAlign = this._textAlign;
}
var tempTextWidth:Number;
var tempTextHeight:Number;
if(this._textWidth > 0){
tempTextWidth = this._textWidth;
} else {
tempTextWidth = NaN;
}
if(this._textHeight > 0){
tempTextHeight = this._textHeight;
} else {
tempTextHeight = NaN;
}
this._containerController = new ContainerController(this, tempTextWidth, tempTextHeight);
this._textFlow.flowComposer.addController(this._containerController);
this._textFlow.flowComposer.updateAllControllers();
Все публичные свойства я бы ожидать, чтобы найти высоту не определены, такие как this._textFlow.lineHeight.
Спасибо,
Крис
Возможно, это нужно будет отобразить один раз, прежде чем свойства, связанные с высотой, получат значения. –