internal void DrawWithTextSelection(Rect position, GUIContent content, int controlID, int firstSelectedCharacter, int lastSelectedCharacter, bool drawSelectionAsComposition)
{
if (Event.current.type != EventType.Repaint)
{
Debug.LogError("Style.Draw may not be called if it is not a repaint event");
}
else
{
Event current = Event.current;
Color cursorColor = new Color(0f, 0f, 0f, 0f);
float cursorFlashSpeed = GUI.skin.settings.cursorFlashSpeed;
float num2 = ((Time.realtimeSinceStartup - Internal_GetCursorFlashOffset()) % cursorFlashSpeed) / cursorFlashSpeed;
if ((cursorFlashSpeed == 0f) || (num2 < 0.5f))
{
cursorColor = GUI.skin.settings.cursorColor;
}
Internal_DrawWithTextSelectionArguments arguments = new Internal_DrawWithTextSelectionArguments {
target = this.m_Ptr,
position = position,
firstPos = firstSelectedCharacter,
lastPos = lastSelectedCharacter,
cursorColor = cursorColor,
selectionColor = GUI.skin.settings.selectionColor,
isHover = !position.Contains(current.mousePosition) ? 0 : 1,
isActive = (controlID != GUIUtility.hotControl) ? 0 : 1,
on = 0,
hasKeyboardFocus = ((controlID != GUIUtility.keyboardControl) || !showKeyboardFocus) ? 0 : 1,
drawSelectionAsComposition = !drawSelectionAsComposition ? 0 : 1
};
Internal_DrawWithTextSelection(content, ref arguments);
}
}