浏览代码

performance improvements...

/main
kg 5 年前
当前提交
6fff9dd6
共有 3 个文件被更改,包括 2 次插入14 次删除
  1. 5
      Runtime/rendering/editable.cs
  2. 9
      Runtime/ui/painting/path.cs
  3. 2
      Runtime/ui/txt/layout.cs

5
Runtime/rendering/editable.cs


public TextPosition getParagraphBackward(TextPosition position, TextAffinity? affinity = null) {
var lineCount = this._textPainter.getLineCount();
if (lineCount == 0) {
return new TextPosition(position.offset, affinity ?? position.affinity);
}
Paragraph.LineRange line = default;
Paragraph.LineRange line = null;
for (int i = lineCount - 1; i >= 0; --i) {
line = this._textPainter.getLineRange(i);
if (i != 0 && !this._textPainter.getLineRange(i - 1).hardBreak) {

9
Runtime/ui/painting/path.cs


public MeshMesh getFillMesh(out bool convex) {
if (this._fillMesh != null) {
convex = this._fillConvex;
if (this._strokeMesh != null) {
Debug.Log("bingo!");
}
return this._fillMesh;
}

this._lineCap == lineCap &&
this._lineJoin == lineJoin &&
this._miterLimit == miterLimit) {
if (this._fillMesh != null) {
Debug.Log("bingo!");
}
return this._strokeMesh;
}

2
Runtime/ui/txt/layout.cs


this._advances.reset(count);
this._positions.reset(count);
this._advance = 0;
this._bounds = UnityEngine.Rect.zero;
this._bounds = default;
var font = FontManager.instance.getOrCreate(style.fontFamily, style.fontWeight, style.fontStyle).font;
font.RequestCharactersInTextureSafe(buff.text, style.UnityFontSize, style.UnityFontStyle);

正在加载...
取消
保存