mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-15 12:31:36 +00:00
优化Background组件的生效条件,需要有单独的父节点
This commit is contained in:
@@ -101,6 +101,7 @@ namespace XCharts
|
||||
/// 警告信息。
|
||||
/// </summary>
|
||||
public string warningInfo { get; protected set; }
|
||||
public bool isControlledByLayout { get { return m_IsControlledByLayout; } }
|
||||
/// <summary>
|
||||
/// 强制开启鼠标事件检测。
|
||||
/// </summary>
|
||||
@@ -733,7 +734,7 @@ namespace XCharts
|
||||
/// <returns></returns>
|
||||
public bool CanShowBackgroundComponent()
|
||||
{
|
||||
return !m_IsControlledByLayout;
|
||||
return !m_IsControlledByLayout && m_Background.runtimeActive;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -744,7 +745,9 @@ namespace XCharts
|
||||
{
|
||||
if (flag && !CanShowBackgroundComponent())
|
||||
{
|
||||
Debug.LogError("can't show background component:chart is controlled by LayoutGroup.");
|
||||
var msg = "The background component cannot be activated because chart is controlled by LayoutGroup,"
|
||||
+ " or its parent have more than one child.";
|
||||
Debug.LogError(msg);
|
||||
return;
|
||||
}
|
||||
m_Background.show = flag;
|
||||
|
||||
Reference in New Issue
Block a user