public void DrawCursor(string newText)
{
string text = this.text;
int num = cursorIndex;
if (Input.compositionString.Length > 0)
{
m_Content.text = newText.Substring(0, cursorIndex) + Input.compositionString + newText.Substring(selectIndex);
num += Input.compositionString.Length;
}
else
{
m_Content.text = newText;
}
graphicalCursorPos = style.GetCursorPixelPosition(new Rect(0f, 0f, position.width, position.height), m_Content, num);
Vector2 contentOffset = style.contentOffset;
style.contentOffset -= scrollOffset;
style.Internal_clipOffset = scrollOffset;
Input.compositionCursorPos = graphicalCursorPos + new Vector2(position.x, position.y + style.lineHeight) - scrollOffset;
if (Input.compositionString.Length > 0)
{
style.DrawWithTextSelection(position, m_Content, controlID, cursorIndex, cursorIndex + Input.compositionString.Length, drawSelectionAsComposition: true);
}
else
{
style.DrawWithTextSelection(position, m_Content, controlID, cursorIndex, selectIndex);
}
if (m_iAltCursorPos != -1)
{
style.DrawCursor(position, m_Content, controlID, m_iAltCursorPos);
}
style.contentOffset = contentOffset;
style.Internal_clipOffset = Vector2.zero;
m_Content.text = text;
}