增加itemStylecornerRadius支持圆角矩形

This commit is contained in:
monitor1394
2020-03-29 10:57:59 +08:00
parent 7eace387c6
commit 5ce1b539d5
16 changed files with 412 additions and 76 deletions

View File

@@ -5,7 +5,8 @@
/* */
/******************************************/
using System;
using System.Collections.Generic;
using UnityEngine;
namespace XCharts
@@ -46,6 +47,7 @@ namespace XCharts
[SerializeField] private Color m_BorderColor;
[SerializeField] [Range(0, 1)] private float m_Opacity = 1;
[SerializeField] private string m_TooltipFormatter;
[SerializeField] private float[] m_CornerRadius = new float[] { 0, 0, 0, 0 };
/// <summary>
/// 是否启用。
@@ -145,6 +147,15 @@ namespace XCharts
set { if (PropertyUtility.SetClass(ref m_TooltipFormatter, value)) SetVerticesDirty(); }
}
/// <summary>
/// The radius of rounded corner. Its unit is px. Use array to respectively specify the 4 corner radiuses((clockwise upper left, upper right, bottom right and bottom left)).
/// 圆角半径。用数组分别指定4个圆角半径顺时针左上右上右下左下
/// </summary>
public float[] cornerRadius
{
get { return m_CornerRadius; }
set { if (PropertyUtility.SetClass(ref m_CornerRadius, value, true)) SetVerticesDirty(); }
}
/// <summary>
/// 实际边框宽。边框不显示时为0。
/// </summary>
public float runtimeBorderWidth { get { return NeedShowBorder() ? borderWidth : 0; } }

View File

@@ -25,7 +25,7 @@ namespace XCharts
/// </summary>
Circle,
/// <summary>
/// 正方形。
/// 正方形。可通过设置`itemStyle`的`cornerRadius`变成圆角矩形。
/// </summary>
Rect,
/// <summary>