private static void DrawCap(int controlID, Vector3 position, GUIStyle guiStyle)
{
if (Event.current.type == EventType.Repaint)
{
Handles.BeginGUI();
position = (Vector3) HandleUtility.WorldToGUIPoint(position);
float fixedWidth = guiStyle.fixedWidth;
float fixedHeight = guiStyle.fixedHeight;
Rect rect = new Rect(position.x - (fixedWidth / 2f), position.y - (fixedHeight / 2f), fixedWidth, fixedHeight);
guiStyle.Draw(rect, GUIContent.none, controlID);
Handles.EndGUI();
}
}