Skip to content

Commit

Permalink
Merge pull request #15599 from apache/fix-line-animation
Browse files Browse the repository at this point in the history
fix(line): not stop existing expand animation when update.
  • Loading branch information
pissang authored Sep 2, 2021
2 parents 93164d9 + cffa380 commit ce461a6
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/chart/line/LineView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,18 @@ class LineView extends ChartView {
}

// Update clipPath
lineGroup.setClipPath(
createLineClipPath(this, coordSys, false, seriesModel)
);
const oldClipPath = lineGroup.getClipPath();
if (oldClipPath) {
const newClipPath = createLineClipPath(this, coordSys, false, seriesModel);
graphic.initProps(oldClipPath, {
shape: newClipPath.shape
}, seriesModel);
}
else {
lineGroup.setClipPath(
createLineClipPath(this, coordSys, true, seriesModel)
);
}

// Always update, or it is wrong in the case turning on legend
// because points are not changed
Expand Down
38 changes: 38 additions & 0 deletions test/line-animation.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ce461a6

Please sign in to comment.