mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-14 20:00:09 +00:00
修复TextLimit在开启TextMeshPro后无效的问题 (#301)
This commit is contained in:
@@ -70,6 +70,7 @@ slug: /changelog
|
||||
|
||||
## master
|
||||
|
||||
* (2024.01.27) 修复`TextLimit`在开启`TextMeshPro`后无效的问题 (#301)
|
||||
* (2024.01.24) 增加`Bar`支持X轴和Y轴都为`Category`类目轴
|
||||
* (2024.01.23) 增加`{y}`通配符用于获取Y轴的类目名
|
||||
* (2024.01.23) 增加`Line`支持X轴和Y轴都为`Category`类目轴
|
||||
|
||||
@@ -263,9 +263,12 @@ namespace XCharts.Runtime
|
||||
public float GetPreferredWidth(string content)
|
||||
{
|
||||
#if dUI_TextMeshPro
|
||||
if (m_TMPText != null) return 0; // TODO:
|
||||
if (m_TMPText != null && !string.IsNullOrEmpty(content))
|
||||
{
|
||||
return m_TMPText.GetPreferredValues(content).x;
|
||||
}
|
||||
#else
|
||||
if (m_Text != null)
|
||||
if (m_Text != null && !string.IsNullOrEmpty(content))
|
||||
{
|
||||
var tg = m_Text.cachedTextGeneratorForLayout;
|
||||
var setting = m_Text.GetGenerationSettings(Vector2.zero);
|
||||
|
||||
Reference in New Issue
Block a user