重构Title相关代码

This commit is contained in:
monitor1394
2025-04-17 22:10:47 +08:00
parent e124d38d3e
commit a0dba26318
7 changed files with 160 additions and 50 deletions

View File

@@ -588,11 +588,6 @@ namespace XCharts.Runtime
}
}
public Vector3 GetTitlePosition(Title title)
{
return chartPosition + title.location.GetPosition(chartWidth, chartHeight);
}
public int GetLegendRealShowNameIndex(string name)
{
return m_LegendRealShowName.IndexOf(name);

View File

@@ -219,5 +219,10 @@ namespace XCharts.Runtime
yield return new WaitForEndOfFrame();
ChartHelper.SaveAsImage(rectTransform, canvas, imageType, path);
}
public Vector3 GetTitlePosition(Title title)
{
return graphPosition + title.location.GetPosition(graphWidth, graphHeight);
}
}
}

View File

@@ -200,7 +200,7 @@ namespace XCharts.Runtime
return s_StringIntDict[prefix][suffix];
}
internal static string GetComponentObjectName(MainComponent component)
public static string GetComponentObjectName(MainComponent component)
{
Dictionary<int, string> dict;
var type = component.GetType();
@@ -224,7 +224,7 @@ namespace XCharts.Runtime
}
}
internal static string GetAxisLabelName(int index)
public static string GetAxisLabelName(int index)
{
string name;
if (!s_AxisLabelName.TryGetValue(index, out name))
@@ -239,12 +239,12 @@ namespace XCharts.Runtime
}
}
internal static string GetTypeName<T>()
public static string GetTypeName<T>()
{
return GetTypeName(typeof(T));
}
internal static string GetTypeName(Type type)
public static string GetTypeName(Type type)
{
if (s_TypeName.ContainsKey(type)) return s_TypeName[type];
else