Cleanup and simplify highlight process, reduce string alloc

This commit is contained in:
Sinai committed 2021-05-10 23:00:02 +10:00
1 parent 1d24af5666
commit cef4c2f3fb
4 files changed
+349 -333

No files matched your search

+1 -2
View File
@@ -30,8 +30,8 @@ namespace UnityExplorer.UI
set => InputField.text = value;
}
public bool ReachedMaxVerts => TextGenerator.vertexCount >= UIManager.MAX_TEXT_VERTS;
public TextGenerator TextGenerator => InputField.cachedInputTextGenerator;
public bool ReachedMaxVerts => TextGenerator.vertexCount >= UIManager.MAX_TEXT_VERTS;
private bool updatedWanted;
@@ -44,7 +44,6 @@ namespace UnityExplorer.UI
{
if (updatedWanted)
{
//LayoutRebuilder.ForceRebuildLayoutImmediate(Rect);
LayoutRebuilder.MarkLayoutForRebuild(Rect);
OnValueChanged?.Invoke(InputField.text);