调整SeriearcShaped参数重命名为roundCap

This commit is contained in:
monitor1394
2020-03-06 07:09:15 +08:00
parent 7465bb760d
commit 2c6d9dc483
7 changed files with 18 additions and 15 deletions

View File

@@ -8,6 +8,7 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Serialization;
namespace XCharts
{
@@ -225,7 +226,8 @@ namespace XCharts
[SerializeField] private float m_StartAngle;
[SerializeField] private float m_EndAngle;
[SerializeField] private bool m_Clockwise;
[SerializeField] private bool m_ArcShaped;
[FormerlySerializedAs("m_ArcShaped")]
[SerializeField] private bool m_RoundCap;
[SerializeField] private int m_SplitNumber;
[SerializeField] private GaugeType m_GaugeType = GaugeType.Pointer;
[SerializeField] private GaugeAxis m_GaugeAxis = new GaugeAxis();
@@ -584,12 +586,12 @@ namespace XCharts
set { if (PropertyUtility.SetStruct(ref m_SplitNumber, value > 36 ? 36 : value)) SetVerticesDirty(); }
}
/// <summary>
/// 是否开启圆弧形边角
/// 是否开启圆弧效果
/// </summary>
public bool arcShaped
public bool roundCap
{
get { return m_ArcShaped; }
set { if (PropertyUtility.SetStruct(ref m_ArcShaped, value)) SetVerticesDirty(); }
get { return m_RoundCap; }
set { if (PropertyUtility.SetStruct(ref m_RoundCap, value)) SetVerticesDirty(); }
}
/// <summary>
/// 仪表盘轴线。

View File

@@ -166,14 +166,14 @@ namespace XCharts
var outsideRadius = serie.runtimeInsideRadius + serie.gaugeAxis.axisLine.width;
ChartDrawer.DrawDoughnut(vh, serie.runtimeCenterPos, serie.runtimeInsideRadius, outsideRadius,
backgroundColor, m_ThemeInfo.backgroundColor, m_Settings.cicleSmoothness, serie.startAngle, serie.endAngle);
if (serie.arcShaped)
if (serie.roundCap)
{
DrawArcShape(vh, serie, serie.startAngle, backgroundColor, true);
DrawArcShape(vh, serie, serie.endAngle, backgroundColor);
}
ChartDrawer.DrawDoughnut(vh, serie.runtimeCenterPos, serie.runtimeInsideRadius, outsideRadius,
color, m_ThemeInfo.backgroundColor, m_Settings.cicleSmoothness, serie.startAngle, currAngle);
if (serie.arcShaped && currAngle != serie.startAngle)
if (serie.roundCap && currAngle != serie.startAngle)
{
DrawArcShape(vh, serie, currAngle, color);
DrawArcShape(vh, serie, serie.startAngle, color, true);

View File

@@ -181,7 +181,7 @@ namespace XCharts
private void DrawArcShape(VertexHelper vh, Serie serie, SerieData serieData, Vector3 centerPos,
Color color, ref float drawStartDegree, ref float drawEndDegree)
{
if (serie.arcShaped && serieData.runtimePieInsideRadius > 0)
if (serie.roundCap && serieData.runtimePieInsideRadius > 0)
{
var width = (serieData.runtimePieOutsideRadius - serieData.runtimePieInsideRadius) / 2;
var radius = serieData.runtimePieInsideRadius + width;