Open
Description
What is the current behavior?
When a line has markup it causes a delay in calling OnLineDisplayComplete
in an ActionMarkupHandler
. This is because this for loop in the LinePresenter includes the markup characters.
Please provide the steps to reproduce, and if possible a minimal demo of the problem:
- Create a basic
ActionMarkupHandler
and attach it to theLinePresenter
. - Add a
Debug.Log
to theOnLineDisplayComplete
method. - Visually compare a line with markup ending in the editor and the delay in the
Debug.Log
firing. - You can also see the markup characters in the
OnCharacterWillAppear
method if you addDebug.Log(line.Text[currentCharacterIndex])
inside.
What is the expected behavior?
OnLineDisplayComplete
is triggered when the text is finished displaying.
Please tell us about your environment:
- Yarn Spinner Version: 3.0.1
- Unity Version: 6000.0.44f1
Other information
I tried using a copy of the LinePresenter
and looping the attributes and calling DeleteRange
on the MarkupParseResult
before the text loop but this resulted in no change. Eg:
foreach (var markupAttribute in text.Attributes)
{
text = text.DeleteRange(markupAttribute);
}
// going through each character of the line and letting the processors know about it
for (int i = 0; i < text.Text.Length; i++) {
...