- コミット日時:
- 2008/12/21 03:30:09 (3 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
as3/Utils/src/org/libspark/utils/StringUtil.as
r908 r2085 25 25 import flash.errors.IllegalOperationError; 26 26 import flash.text.TextField; 27 import flash.text.TextFormat; 27 28 import flash.utils.ByteArray; 28 29 … … 146 147 if ( param == null ) param = ""; 147 148 var n:uint = param.length + 1; 149 var textFormat:TextFormat = textField.getTextFormat(); // 初期状態のTextFormatを記憶 by nagase at ngsdev.org 148 150 while( textField.textWidth > width ){ 149 151 if (textField.textWidth > width * 2) { … … 151 153 } 152 154 textField.text = textField.text.substr(0, textField.text.length - n) + param; 155 textField.setTextFormat(textFormat); // TextFormatを復元 153 156 } 154 157 }

