mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-19 15:00:08 +00:00
增加Axis可通过设置IconStyle的color为clear来实现动态图标颜色的支持
This commit is contained in:
@@ -130,7 +130,7 @@ namespace XCharts.Runtime
|
||||
if (m_IconRect != null) m_IconRect.sizeDelta = new Vector3(width, height);
|
||||
}
|
||||
|
||||
public void UpdateIcon(IconStyle iconStyle, Sprite sprite = null)
|
||||
public void UpdateIcon(IconStyle iconStyle, Sprite sprite = null, Color color = default(Color))
|
||||
{
|
||||
if (m_IconImage == null || iconStyle == null)
|
||||
return;
|
||||
@@ -139,7 +139,7 @@ namespace XCharts.Runtime
|
||||
if (iconStyle.show)
|
||||
{
|
||||
m_IconImage.sprite = sprite == null ? iconStyle.sprite : sprite;
|
||||
m_IconImage.color = iconStyle.color;
|
||||
m_IconImage.color = ChartHelper.IsClearColor(iconStyle.color) ? color : iconStyle.color;
|
||||
m_IconImage.type = iconStyle.type;
|
||||
m_IconRect.sizeDelta = new Vector2(iconStyle.width, iconStyle.height);
|
||||
m_IconOffest = iconStyle.offset;
|
||||
|
||||
Reference in New Issue
Block a user