From 2b357512c4da38b62151d4ac1865083125f83f19 Mon Sep 17 00:00:00 2001 From: js6pak Date: Sat, 17 Aug 2024 05:23:38 +0200 Subject: [PATCH] Cleanup text after calling GetTextInfo Turns out GetTextInfo changes text internally and because TextBoxTMP#GiveFocus now sets caretPos based on text length it was causing crashes. --- Reactor/Patches/Fixes/CursorPosPatch.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Reactor/Patches/Fixes/CursorPosPatch.cs b/Reactor/Patches/Fixes/CursorPosPatch.cs index 623bac1..d8d6880 100644 --- a/Reactor/Patches/Fixes/CursorPosPatch.cs +++ b/Reactor/Patches/Fixes/CursorPosPatch.cs @@ -23,6 +23,7 @@ internal static class CursorPosPatch 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; }