No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DrawUserIcon.cs 743B

123456789101112131415161718192021222324252627
  1. using UnityEditor;
  2. using UnityEngine;
  3. namespace Unity.PlasticSCM.Editor.UI
  4. {
  5. internal static class DrawUserIcon
  6. {
  7. static internal void ForPendingChangesTab(string commentText)
  8. {
  9. Rect rect = BuildUserIconAreaRect(commentText, 35f);
  10. GUI.DrawTexture(rect, Images.GetEmptyGravatar());
  11. }
  12. static Rect BuildUserIconAreaRect(string commentText, float sizeOfImage)
  13. {
  14. GUIStyle commentTextAreaStyle = UnityStyles.PendingChangesTab.CommentTextArea;
  15. Rect result = GUILayoutUtility.GetRect(sizeOfImage, sizeOfImage); // Needs to be a square
  16. result.x = commentTextAreaStyle.margin.left;
  17. return result;
  18. }
  19. }
  20. }