暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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. }