UnityEditor.ASHistoryWindow.DrawBadge C# (CSharp) Method

DrawBadge() private method

private DrawBadge ( Rect offset, ChangeFlags flags, GUIStyle style, GUIContent content, float textColWidth ) : void
offset UnityEngine.Rect
flags ChangeFlags
style UnityEngine.GUIStyle
content UnityEngine.GUIContent
textColWidth float
return void
        private void DrawBadge(Rect offset, ChangeFlags flags, GUIStyle style, GUIContent content, float textColWidth)
        {
            if (Event.current.type == EventType.Repaint)
            {
                GUIContent badgeNew = null;
                if (this.HasFlag(flags, ChangeFlags.Undeleted) || this.HasFlag(flags, ChangeFlags.Created))
                {
                    badgeNew = ASMainWindow.constants.badgeNew;
                }
                else if (this.HasFlag(flags, ChangeFlags.Deleted))
                {
                    badgeNew = ASMainWindow.constants.badgeDelete;
                }
                else if (this.HasFlag(flags, ChangeFlags.Renamed) || this.HasFlag(flags, ChangeFlags.Moved))
                {
                    badgeNew = ASMainWindow.constants.badgeMove;
                }
                if (badgeNew != null)
                {
                    float num2;
                    if (style.CalcSize(content).x > (textColWidth - badgeNew.image.width))
                    {
                        num2 = (offset.xMax - badgeNew.image.width) - 5f;
                    }
                    else
                    {
                        num2 = textColWidth - badgeNew.image.width;
                    }
                    Rect position = new Rect(num2, (offset.y + (offset.height / 2f)) - (badgeNew.image.height / 2), (float) badgeNew.image.width, (float) badgeNew.image.height);
                    EditorGUIUtility.SetIconSize(Vector2.zero);
                    GUIStyle.none.Draw(position, badgeNew, false, false, false, false);
                    EditorGUIUtility.SetIconSize(ms_IconSize);
                }
            }
        }