Skip to content

Commit

Permalink
Merge pull request #1457 from VisActor/fix/segment-update-error
Browse files Browse the repository at this point in the history
Fix/segment update error
  • Loading branch information
xile611 authored Sep 24, 2024
2 parents 0a80cd9 + a48e955 commit 3c1f39e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-core",
"comment": "fix: line segment update animation result error",
"type": "none"
}
],
"packageName": "@visactor/vrender-core"
}
5 changes: 3 additions & 2 deletions packages/vrender-core/src/animate/custom-animate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,9 @@ export class TagPointsUpdate extends ACustomAnimate<{ points?: IPointLike[]; seg
if (this.segmentsCache && this.to.segments) {
let start = 0;
out.segments = this.to.segments.map((segment, index) => {
const points = this.points.slice(start, this.segmentsCache[start]);
start += this.segmentsCache[start];
const end = start + this.segmentsCache[index];
const points = this.points.slice(start, end);
start = end;
return {
...segment,
points
Expand Down

0 comments on commit 3c1f39e

Please sign in to comment.