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.
27 lines
546 B
27 lines
546 B
2 years ago
|
using System;
|
||
|
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace Unity.PlasticSCM.Editor.UI
|
||
|
{
|
||
|
internal static class MeasureMaxWidth
|
||
|
{
|
||
|
internal static float ForTexts(GUIStyle style, params string[] texts)
|
||
|
{
|
||
|
float result = 0;
|
||
|
|
||
|
GUIContent content = new GUIContent();
|
||
|
|
||
|
foreach (string text in texts)
|
||
|
{
|
||
|
content.text = text;
|
||
|
|
||
|
result = Math.Max(result,
|
||
|
style.CalcSize(content).x);
|
||
|
}
|
||
|
|
||
|
return result + 10;
|
||
|
}
|
||
|
}
|
||
|
}
|