mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-16 13:30:10 +00:00
修复TextLimit在开启TextMeshPro后无效的问题 (#301)
This commit is contained in:
@@ -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