/// <summary> /// Draw a DiffLabel, which draws a simple EditorGUILabel populated with the results from a rename op (diff). /// </summary> /// <param name="rect">Rect to draw in</param> /// <param name="renameResult">The result of a RenameOp, which contains the diffs to render</param> /// <param name="showBefore">Flag to show the name before the op, instead of the result</param> /// <param name="resultLabelStyle">Style of the DiffLabel</param> /// <param name="style">Style for the EditorGUILabel itself</param> public static void DrawDiffLabel(Rect rect, RenameResult renameResult, bool showBefore, DiffLabelStyle resultLabelStyle, GUIStyle style) { var labelText = string.Empty; if (!resultLabelStyle.HideDiff) { ApplyBackgroundColorToDiff( rect, style, renameResult, resultLabelStyle.OperationToShow, resultLabelStyle.DiffBackgroundColor); } labelText = showBefore ? renameResult.GetOriginalColored(resultLabelStyle.DiffTextColor) : renameResult.GetResultColored(resultLabelStyle.DiffTextColor); EditorGUI.LabelField(rect, labelText, style); }