From e078e69e4d7dd7d651bf9218d4be9d1d8bfb936e Mon Sep 17 00:00:00 2001 From: xiaoluoHe Date: Thu, 16 Jan 2025 14:26:46 +0800 Subject: [PATCH] fix: fix the issue where the final text of the label increase count animation is incorrect --- .../fix-label-increaseCount_2025-01-16-06-26.json | 10 ++++++++++ packages/vrender-core/src/animate/custom-animate.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 common/changes/@visactor/vrender-core/fix-label-increaseCount_2025-01-16-06-26.json diff --git a/common/changes/@visactor/vrender-core/fix-label-increaseCount_2025-01-16-06-26.json b/common/changes/@visactor/vrender-core/fix-label-increaseCount_2025-01-16-06-26.json new file mode 100644 index 000000000..c2e045c77 --- /dev/null +++ b/common/changes/@visactor/vrender-core/fix-label-increaseCount_2025-01-16-06-26.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vrender-core", + "comment": "fix: fix the issue where the final text of the label increase count animation is incorrect", + "type": "none" + } + ], + "packageName": "@visactor/vrender-core" +} \ No newline at end of file diff --git a/packages/vrender-core/src/animate/custom-animate.ts b/packages/vrender-core/src/animate/custom-animate.ts index 3d3aa85a7..d08b045ef 100644 --- a/packages/vrender-core/src/animate/custom-animate.ts +++ b/packages/vrender-core/src/animate/custom-animate.ts @@ -87,7 +87,7 @@ export class IncreaseCount extends ACustomAnimate<{ text: string | number }> { return; } if (end) { - out.text = this.toNumber; + out.text = this.to?.text; } else { out.text = (this.fromNumber + (this.toNumber - this.fromNumber) * ratio).toFixed(this.decimalLength); }