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