From 2e604529ee47a547ddc53b68a1106645de494e8a Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Wed, 4 Dec 2024 09:18:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86`Unity`=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/Internal/Utilities/ChartHelper.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Runtime/Internal/Utilities/ChartHelper.cs b/Runtime/Internal/Utilities/ChartHelper.cs index 4e1d72b7..f72c7c99 100644 --- a/Runtime/Internal/Utilities/ChartHelper.cs +++ b/Runtime/Internal/Utilities/ChartHelper.cs @@ -297,7 +297,11 @@ namespace XCharts.Runtime chartText.tmpText.fontStyle = textStyle.tmpFontStyle; chartText.tmpText.richText = true; chartText.tmpText.raycastTarget = false; +#if UNITY_2023_2_OR_NEWER + chartText.tmpText.textWrappingMode = textStyle.autoWrap ? TextWrappingModes.Normal : TextWrappingModes.NoWrap; +#else chartText.tmpText.enableWordWrapping = textStyle.autoWrap; +#endif #else chartText.text = EnsureComponent(txtObj); chartText.text.font = textStyle.font == null ? theme.font : textStyle.font;