浏览代码

Fix some issues.

/main
Yuncong Zhang 5 年前
当前提交
d8d389be
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. 12
      Runtime/ui/txt/paragraph.cs

12
Runtime/ui/txt/paragraph.cs


}
public void layout(ParagraphConstraints constraints) {
if (!this._needsLayout && this._width == constraints.width) {
if ((!this._needsLayout && this._width == constraints.width) ||
this._text == null || this._text.isEmpty()) {
return;
}

}
internal void setText(string text, StyledRuns runs, bool skipRequestCharacters = false) {
if (text == null || text.isEmpty()) {
this.clear();
this._text = text;
this._runs = runs;
this._needsLayout = false;
return;
}
this._text = text;
this._runs = runs;
this._needsLayout = true;

var run = runs.getRun(i);
var font = FontManager.instance.getOrCreate(style.fontFamily, style.fontWeight, style.fontStyle).font;
font.RequestCharactersInTextureSafe(text.Substring(run.start, run.end - run.start),
Mathf.CeilToInt(style.fontSize), style.UnityFontStyle);
style.UnityFontSize, style.UnityFontStyle);
}
}
}

正在加载...
取消
保存