Only lexer-highlight what is shown in CS console (fix max vert overflow)

This commit is contained in:
Sinai committed 2021-05-10 21:07:27 +10:00
1 parent 4f50afdddc
commit 1d24af5666
7 files changed
+182 -93

No files matched your search

+6 -2
View File
@@ -22,7 +22,7 @@ namespace UnityExplorer.UI
public InputField InputField;
public Text PlaceholderText;
private readonly RectTransform Rect;
public RectTransform Rect;
public string Text
{
@@ -30,6 +30,9 @@ namespace UnityExplorer.UI
set => InputField.text = value;
}
public bool ReachedMaxVerts => TextGenerator.vertexCount >= UIManager.MAX_TEXT_VERTS;
public TextGenerator TextGenerator => InputField.cachedInputTextGenerator;
private bool updatedWanted;
private void OnInputChanged(string value)
@@ -41,7 +44,8 @@ namespace UnityExplorer.UI
{
if (updatedWanted)
{
LayoutRebuilder.ForceRebuildLayoutImmediate(Rect);
//LayoutRebuilder.ForceRebuildLayoutImmediate(Rect);
LayoutRebuilder.MarkLayoutForRebuild(Rect);
OnValueChanged?.Invoke(InputField.text);
updatedWanted = false;