浏览代码

Reuse this._lineBaseLines, this._glyphLines and this._lineHeights

between layouts.
/main
Yuncong Zhang 5 年前
当前提交
97fb2535
共有 1 个文件被更改,包括 12 次插入3 次删除
  1. 15
      Runtime/ui/txt/paragraph.cs

15
Runtime/ui/txt/paragraph.cs


this._codeUnitRuns.Clear();
this._computeLineBreak();
this._glyphLines = new GlyphLine[this._lineRanges.Count];
this._lineBaseLines = new float[this._lineRanges.Count];
this._lineHeights = new float[this._lineRanges.Count];
if (this._glyphLines == null || this._glyphLines.Length < this._lineRanges.Count) {
this._glyphLines = new GlyphLine[this._lineRanges.Count];
}
if (this._lineBaseLines == null || this._lineBaseLines.Length < this._lineRanges.Count) {
this._lineBaseLines = new float[this._lineRanges.Count];
}
if (this._lineHeights == null || this._lineHeights.Length < this._lineRanges.Count) {
this._lineHeights = new float[this._lineRanges.Count];
}
int styleMaxLines = this._paragraphStyle.maxLines ?? int.MaxValue;
this._didExceedMaxLines = this._lineRanges.Count > styleMaxLines;

正在加载...
取消
保存