优化性能

This commit is contained in:
monitor1394
2024-11-27 23:24:09 +08:00
parent ad77a79308
commit 6c42fe6399

View File

@@ -656,10 +656,12 @@ namespace XCharts.Runtime
} }
} }
private Background m_Background;
public Color32 GetChartBackgroundColor() public Color32 GetChartBackgroundColor()
{ {
var background = GetChartComponent<Background>(); if (m_Background == null) m_Background = GetChartComponent<Background>();
return theme.GetBackgroundColor(background); //var background = GetChartComponent<Background>();
return theme.GetBackgroundColor(m_Background);
} }
/// <summary> /// <summary>