mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-29 12:48:47 +00:00
修复笛卡尔坐标系开启动画时绘制异常的问题
This commit is contained in:
@@ -87,6 +87,7 @@ namespace XCharts
|
|||||||
{
|
{
|
||||||
if (m_IsEnd) return;
|
if (m_IsEnd) return;
|
||||||
m_ActualDuration = (int)((Time.time - startTime) * 1000) - delay;
|
m_ActualDuration = (int)((Time.time - startTime) * 1000) - delay;
|
||||||
|
m_CurrDataProgress = m_DestDataProgress + 1;
|
||||||
m_IsEnd = true;
|
m_IsEnd = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +109,7 @@ namespace XCharts
|
|||||||
|
|
||||||
public void SetDataFinish(int dataIndex)
|
public void SetDataFinish(int dataIndex)
|
||||||
{
|
{
|
||||||
if (dataIndex < dataState.Count && !dataState[dataIndex])
|
if (!m_IsEnd && dataIndex < dataState.Count && !dataState[dataIndex])
|
||||||
{
|
{
|
||||||
dataState[dataIndex] = true;
|
dataState[dataIndex] = true;
|
||||||
m_CurrDataProgress = dataIndex + 1;
|
m_CurrDataProgress = dataIndex + 1;
|
||||||
@@ -120,14 +121,7 @@ namespace XCharts
|
|||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (!Application.isPlaying) return true;
|
if (!Application.isPlaying) return true;
|
||||||
#endif
|
#endif
|
||||||
return !enable || (m_CurrDataProgress>m_DestDataProgress && m_CurrDetailProgress > m_DestDetailProgress);
|
return !enable || (m_CurrDataProgress > m_DestDataProgress && m_CurrDetailProgress > m_DestDetailProgress);
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsFinishData(int dataIndex)
|
|
||||||
{
|
|
||||||
if (!m_Enable) return true;
|
|
||||||
if (dataIndex < dataState.Count) return dataState[dataIndex];
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsInDelay()
|
public bool IsInDelay()
|
||||||
|
|||||||
@@ -392,7 +392,7 @@ namespace XCharts
|
|||||||
bool isStart = false;
|
bool isStart = false;
|
||||||
for (int i = 1; i < segment; i++)
|
for (int i = 1; i < segment; i++)
|
||||||
{
|
{
|
||||||
var cp = lp + dist * i / segment * dir1;
|
var cp = lp + dir1 *(dist * i / segment);
|
||||||
if (serie.animation.CheckDetailBreak(cp, isYAxis)) isBreak = true;
|
if (serie.animation.CheckDetailBreak(cp, isYAxis)) isBreak = true;
|
||||||
var tp1 = cp - dir1v * serie.lineStyle.width;
|
var tp1 = cp - dir1v * serie.lineStyle.width;
|
||||||
var tp2 = cp + dir1v * serie.lineStyle.width;
|
var tp2 = cp + dir1v * serie.lineStyle.width;
|
||||||
@@ -402,7 +402,7 @@ namespace XCharts
|
|||||||
{
|
{
|
||||||
if (!isStart)
|
if (!isStart)
|
||||||
{
|
{
|
||||||
if ((isYAxis && tp1.y > lastDnPos.y) || (!isYAxis && tp1.x > lastDnPos.x) || dataIndex == 1)
|
if ((isYAxis && tp1.y > lastDnPos.y) || (!isYAxis && tp1.x > lastDnPos.x) || dataIndex == 1 || IsValue())
|
||||||
{
|
{
|
||||||
isStart = true;
|
isStart = true;
|
||||||
ChartHelper.DrawPolygon(vh, stPos1, tp1, tp2, stPos2, lineColor);
|
ChartHelper.DrawPolygon(vh, stPos1, tp1, tp2, stPos2, lineColor);
|
||||||
@@ -421,7 +421,7 @@ namespace XCharts
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((isYAxis && tp2.y < dnPos.y) || (!isYAxis && tp2.x < dnPos.x))
|
if ((isYAxis && tp2.y < dnPos.y) || (!isYAxis && tp2.x < dnPos.x) || IsValue())
|
||||||
{
|
{
|
||||||
ChartHelper.DrawLine(vh, start, cp, serie.lineStyle.width, lineColor);
|
ChartHelper.DrawLine(vh, start, cp, serie.lineStyle.width, lineColor);
|
||||||
}
|
}
|
||||||
@@ -437,13 +437,13 @@ namespace XCharts
|
|||||||
|
|
||||||
if (isYAxis)
|
if (isYAxis)
|
||||||
{
|
{
|
||||||
if (tp1.y > lastDnPos.y || dataIndex == 1) smoothPoints.Add(tp1);
|
if (tp1.y > lastDnPos.y || dataIndex == 1 || IsValue()) smoothPoints.Add(tp1);
|
||||||
if (tp2.y < dnPos.y) smoothDownPoints.Add(tp2);
|
if (tp2.y < dnPos.y|| IsValue()) smoothDownPoints.Add(tp2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (tp1.x > lastDnPos.x || dataIndex == 1) smoothPoints.Add(tp1);
|
if (tp1.x > lastDnPos.x || dataIndex == 1|| IsValue()) smoothPoints.Add(tp1);
|
||||||
if (tp2.x < dnPos.x || dataIndex == 1) smoothDownPoints.Add(tp2);
|
if (tp2.x < dnPos.x || dataIndex == 1|| IsValue()) smoothDownPoints.Add(tp2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -452,7 +452,7 @@ namespace XCharts
|
|||||||
{
|
{
|
||||||
if (!isStart)
|
if (!isStart)
|
||||||
{
|
{
|
||||||
if ((isYAxis && tp2.y > lastDnPos.y) || (!isYAxis && tp2.x > lastDnPos.x) || dataIndex == 1)
|
if ((isYAxis && tp2.y > lastDnPos.y) || (!isYAxis && tp2.x > lastDnPos.x) || dataIndex == 1|| IsValue())
|
||||||
{
|
{
|
||||||
isStart = true;
|
isStart = true;
|
||||||
ChartHelper.DrawPolygon(vh, stPos1, tp1, tp2, stPos2, lineColor);
|
ChartHelper.DrawPolygon(vh, stPos1, tp1, tp2, stPos2, lineColor);
|
||||||
@@ -471,7 +471,7 @@ namespace XCharts
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((isYAxis && tp1.y < dnPos.y) || (!isYAxis && tp1.x < dnPos.x))
|
if ((isYAxis && tp1.y < dnPos.y) || (!isYAxis && tp1.x < dnPos.x)|| IsValue())
|
||||||
ChartHelper.DrawLine(vh, start, cp, serie.lineStyle.width, lineColor);
|
ChartHelper.DrawLine(vh, start, cp, serie.lineStyle.width, lineColor);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -485,13 +485,13 @@ namespace XCharts
|
|||||||
|
|
||||||
if (isYAxis)
|
if (isYAxis)
|
||||||
{
|
{
|
||||||
if (tp1.y < dnPos.y) smoothPoints.Add(tp1);
|
if (tp1.y < dnPos.y|| IsValue()) smoothPoints.Add(tp1);
|
||||||
if (tp2.y > lastDnPos.y || dataIndex == 1) smoothDownPoints.Add(tp2);
|
if (tp2.y > lastDnPos.y || dataIndex == 1|| IsValue()) smoothDownPoints.Add(tp2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (tp1.x < dnPos.x) smoothPoints.Add(tp1);
|
if (tp1.x < dnPos.x|| IsValue()) smoothPoints.Add(tp1);
|
||||||
if (tp2.x > lastDnPos.x || dataIndex == 1) smoothDownPoints.Add(tp2);
|
if (tp2.x > lastDnPos.x || dataIndex == 1|| IsValue()) smoothDownPoints.Add(tp2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
start = cp;
|
start = cp;
|
||||||
|
|||||||
Reference in New Issue
Block a user