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.

MeasureMaxWidth.cs 546B

1234567891011121314151617181920212223242526
  1. using System;
  2. using UnityEngine;
  3. namespace Unity.PlasticSCM.Editor.UI
  4. {
  5. internal static class MeasureMaxWidth
  6. {
  7. internal static float ForTexts(GUIStyle style, params string[] texts)
  8. {
  9. float result = 0;
  10. GUIContent content = new GUIContent();
  11. foreach (string text in texts)
  12. {
  13. content.text = text;
  14. result = Math.Max(result,
  15. style.CalcSize(content).x);
  16. }
  17. return result + 10;
  18. }
  19. }
  20. }