Skip to content

Commit

Permalink
Cleanup text after calling GetTextInfo
Browse files Browse the repository at this point in the history
Turns out GetTextInfo changes text internally and because TextBoxTMP#GiveFocus now sets caretPos based on text length it was causing crashes.
  • Loading branch information
js6pak committed Aug 17, 2024
1 parent a2f37df commit 5dafd7f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Reactor/Patches/Fixes/CursorPosPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public static bool Prefix(TextMeshPro self, ref Vector2 __result)
if (self.textInfo == null || self.textInfo.lineCount == 0 || self.textInfo.lineInfo[0].characterCount <= 0)
{
__result = self.GetTextInfo(" ").lineInfo.First().lineExtents.max;
self.text = string.Empty;
return false;
}

Expand Down

0 comments on commit 5dafd7f

Please sign in to comment.