mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-19 06:50:18 +00:00
增加Settings的reversePainter可设置Serie的绘制是否逆序
This commit is contained in:
@@ -18,6 +18,7 @@ namespace XCharts
|
||||
public class Settings : MainComponent
|
||||
{
|
||||
[SerializeField] [Range(1, 20)] protected int m_MaxPainter = 10;
|
||||
[SerializeField] protected bool m_ReversePainter = false;
|
||||
[SerializeField] [Range(1, 10)] protected float m_LineSmoothStyle = 3f;
|
||||
[SerializeField] [Range(1f, 20)] protected float m_LineSmoothness = 2f;
|
||||
[SerializeField] [Range(1f, 20)] protected float m_LineSegmentDistance = 3f;
|
||||
@@ -35,6 +36,14 @@ namespace XCharts
|
||||
set { if (PropertyUtil.SetStruct(ref m_MaxPainter, value < 0 ? 1 : value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Painter是否逆序。逆序时index大的serie最先绘制。
|
||||
/// </summary>
|
||||
public bool reversePainter
|
||||
{
|
||||
get { return m_ReversePainter; }
|
||||
set { if (PropertyUtil.SetStruct(ref m_ReversePainter, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Curve smoothing factor. By adjusting the smoothing coefficient, the curvature of the curve can be changed,
|
||||
/// and different curves with slightly different appearance can be obtained.
|
||||
/// 曲线平滑系数。通过调整平滑系数可以改变曲线的曲率,得到外观稍微有变化的不同曲线。
|
||||
@@ -99,6 +108,7 @@ namespace XCharts
|
||||
|
||||
public void Copy(Settings settings)
|
||||
{
|
||||
m_ReversePainter = settings.reversePainter;
|
||||
m_MaxPainter = settings.maxPainter;
|
||||
m_LineSmoothStyle = settings.lineSmoothStyle;
|
||||
m_LineSmoothness = settings.lineSmoothness;
|
||||
@@ -119,6 +129,7 @@ namespace XCharts
|
||||
{
|
||||
return new Settings()
|
||||
{
|
||||
m_ReversePainter = false,
|
||||
m_MaxPainter = XChartsSettings.maxPainter,
|
||||
m_LineSmoothStyle = XChartsSettings.lineSmoothStyle,
|
||||
m_LineSmoothness = XChartsSettings.lineSmoothness,
|
||||
|
||||
Reference in New Issue
Block a user