修复Line设置AnimationAlongPath时动画异常的问题 (#281)

This commit is contained in:
monitor1394
2023-10-15 21:04:01 +08:00
parent 38716facba
commit 6a5026e907
2 changed files with 7 additions and 6 deletions

View File

@@ -304,12 +304,6 @@ 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)
@@ -328,6 +322,12 @@ namespace XCharts.Runtime
m_LinePathLastPos = sp;
context.currentPathDistance = 0;
}
if (sp == anim.context.currPoint && ep == anim.context.destPoint)
{
return;
}
anim.context.currPoint = sp;
anim.context.destPoint = ep;
anim.Init(currDetailProgress, totalDetailProgress, paths.Count - 1);
}