mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-26 19:00:24 +00:00
修复Theme在修改默认主题的参数后运行被重置的问题
This commit is contained in:
@@ -66,6 +66,7 @@ slug: /changelog
|
|||||||
|
|
||||||
## master
|
## master
|
||||||
|
|
||||||
|
* (2023.05.04) 修复`Theme`在修改默认主题的参数后运行被重置的问题
|
||||||
* (2023.05.04) 增加`Symbol`选择`Custom`类型时的`Warning`提示
|
* (2023.05.04) 增加`Symbol`选择`Custom`类型时的`Warning`提示
|
||||||
* (2023.04.15) 修复`DataZoom`在多个图表时可能异常的问题 (#252)
|
* (2023.04.15) 修复`DataZoom`在多个图表时可能异常的问题 (#252)
|
||||||
* (2023.04.14) 修复`Tooltip`在只有一个数据时可能异常的问题
|
* (2023.04.14) 修复`Tooltip`在只有一个数据时可能异常的问题
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
[AddComponentMenu("XCharts/EmptyChart", 10)]
|
[AddComponentMenu("XCharts/EmptyChart", 10)]
|
||||||
[ExecuteInEditMode]
|
[ExecuteInEditMode]
|
||||||
[RequireComponent(typeof(RectTransform),typeof(CanvasRenderer))]
|
[RequireComponent(typeof(RectTransform), typeof(CanvasRenderer))]
|
||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
public partial class BaseChart : BaseGraph, ISerializationCallbackReceiver
|
public partial class BaseChart : BaseGraph, ISerializationCallbackReceiver
|
||||||
{
|
{
|
||||||
@@ -131,7 +131,7 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
if (m_Settings == null)
|
if (m_Settings == null)
|
||||||
m_Settings = Settings.DefaultSettings;
|
m_Settings = Settings.DefaultSettings;
|
||||||
CheckTheme();
|
CheckTheme(true);
|
||||||
base.Awake();
|
base.Awake();
|
||||||
InitComponentHandlers();
|
InitComponentHandlers();
|
||||||
InitSerieHandlers();
|
InitSerieHandlers();
|
||||||
@@ -244,12 +244,16 @@ namespace XCharts.Runtime
|
|||||||
painter.SetActive(flag, m_DebugInfo.showAllChartObject);
|
painter.SetActive(flag, m_DebugInfo.showAllChartObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void CheckTheme()
|
protected virtual void CheckTheme(bool firstInit = false)
|
||||||
{
|
{
|
||||||
if (m_Theme.sharedTheme == null)
|
if (m_Theme.sharedTheme == null)
|
||||||
{
|
{
|
||||||
m_Theme.sharedTheme = XCThemeMgr.GetTheme(ThemeType.Default);
|
m_Theme.sharedTheme = XCThemeMgr.GetTheme(ThemeType.Default);
|
||||||
}
|
}
|
||||||
|
if (firstInit)
|
||||||
|
{
|
||||||
|
m_CheckTheme = m_Theme.themeType;
|
||||||
|
}
|
||||||
if (m_Theme.sharedTheme != null && m_CheckTheme != m_Theme.themeType)
|
if (m_Theme.sharedTheme != null && m_CheckTheme != m_Theme.themeType)
|
||||||
{
|
{
|
||||||
m_CheckTheme = m_Theme.themeType;
|
m_CheckTheme = m_Theme.themeType;
|
||||||
|
|||||||
Reference in New Issue
Block a user