Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit 62da11b

Browse files
committed
performance improvements...
1 parent 1f92441 commit 62da11b

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

Runtime/rendering/editable.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -877,11 +877,8 @@ public TextPosition getParagraphForward(TextPosition position, TextAffinity? aff
877877

878878
public TextPosition getParagraphBackward(TextPosition position, TextAffinity? affinity = null) {
879879
var lineCount = this._textPainter.getLineCount();
880-
if (lineCount == 0) {
881-
return new TextPosition(position.offset, affinity ?? position.affinity);
882-
}
883880

884-
Paragraph.LineRange line = default;
881+
Paragraph.LineRange line = null;
885882
for (int i = lineCount - 1; i >= 0; --i) {
886883
line = this._textPainter.getLineRange(i);
887884
if (i != 0 && !this._textPainter.getLineRange(i - 1).hardBreak) {

Runtime/ui/painting/path.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,10 +1555,6 @@ void _expandFill() {
15551555
public MeshMesh getFillMesh(out bool convex) {
15561556
if (this._fillMesh != null) {
15571557
convex = this._fillConvex;
1558-
1559-
if (this._strokeMesh != null) {
1560-
Debug.Log("bingo!");
1561-
}
15621558
return this._fillMesh;
15631559
}
15641560

@@ -1799,11 +1795,6 @@ public MeshMesh getStrokeMesh(float strokeWidth, StrokeCap lineCap, StrokeJoin l
17991795
this._lineCap == lineCap &&
18001796
this._lineJoin == lineJoin &&
18011797
this._miterLimit == miterLimit) {
1802-
1803-
if (this._fillMesh != null) {
1804-
Debug.Log("bingo!");
1805-
}
1806-
18071798
return this._strokeMesh;
18081799
}
18091800

Runtime/ui/txt/layout.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void doLayout(float offset, TextBuff buff, int start, int count, TextStyl
3636
this._advances.reset(count);
3737
this._positions.reset(count);
3838
this._advance = 0;
39-
this._bounds = UnityEngine.Rect.zero;
39+
this._bounds = default;
4040

4141
var font = FontManager.instance.getOrCreate(style.fontFamily, style.fontWeight, style.fontStyle).font;
4242
font.RequestCharactersInTextureSafe(buff.text, style.UnityFontSize, style.UnityFontStyle);

0 commit comments

Comments
 (0)