mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-14 20:00:09 +00:00
优化DataZoom开启时的新增动画表现
This commit is contained in:
@@ -17,6 +17,8 @@ namespace XCharts.Runtime
|
||||
public float sizeProgress;
|
||||
public int currPointIndex;
|
||||
public int destPointIndex;
|
||||
public Vector3 currPoint;
|
||||
public Vector3 destPoint;
|
||||
public Dictionary<int, float> dataCurrProgress = new Dictionary<int, float>();
|
||||
public Dictionary<int, float> dataDestProgress = new Dictionary<int, float>();
|
||||
}
|
||||
|
||||
@@ -284,7 +284,11 @@ namespace XCharts.Runtime
|
||||
{
|
||||
if (paths.Count < 1) return;
|
||||
var anim = activedAnimation;
|
||||
if (anim == null) return;
|
||||
if (anim == null)
|
||||
{
|
||||
m_Addition.context.currPointIndex = paths.Count - 1;
|
||||
return;
|
||||
}
|
||||
var isAddedAnim = anim is AnimationAddition;
|
||||
var startIndex = 0;
|
||||
if (isAddedAnim)
|
||||
@@ -300,6 +304,12 @@ namespace XCharts.Runtime
|
||||
}
|
||||
var sp = paths[startIndex];
|
||||
var ep = paths[paths.Count - 1];
|
||||
if (sp == anim.context.currPoint && ep == anim.context.destPoint)
|
||||
{
|
||||
return;
|
||||
}
|
||||
anim.context.currPoint = sp;
|
||||
anim.context.destPoint = ep;
|
||||
var currDetailProgress = isY ? sp.y : sp.x;
|
||||
var totalDetailProgress = isY ? ep.y : ep.x;
|
||||
if (context.type == AnimationType.AlongPath)
|
||||
|
||||
Reference in New Issue
Block a user