We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92d25be commit 0190765Copy full SHA for 0190765
Runtime/ThaiTextNurse/ThaiTextNurse.cs
@@ -352,18 +352,14 @@ public static void VisualizeInEditor(ThaiTextNurse nurse)
352
return;
353
354
var breakIndices = new List<int>();
355
- var wordLeftCount = nurse.LastWordCount;
356
for (int i = 0; i < nurse.CharacterInfoLength; i++)
357
{
+ //This is needed because CharacterInfos are kind of unreliable on undo
358
+ if (i > nurse.outputString.Length)
359
+ break;
360
+
361
if (nurse.GetCharacterInfo(i).character == breakCharacter[0])
- {
362
breakIndices.Add(i);
-
- //This is needed because CharacterInfos are kind of unreliable on undo
363
- wordLeftCount--;
364
- if (wordLeftCount <= 1)
365
- break;
366
- }
367
}
368
369
var oldColor = Handles.color;
0 commit comments