mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-23 01:10:08 +00:00
增加itemStyle的cornerRadius支持圆角矩形
This commit is contained in:
@@ -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; } }
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace XCharts
|
||||
/// </summary>
|
||||
Circle,
|
||||
/// <summary>
|
||||
/// 正方形。
|
||||
/// 正方形。可通过设置`itemStyle`的`cornerRadius`变成圆角矩形。
|
||||
/// </summary>
|
||||
Rect,
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user