diff --git a/common/changes/@visactor/vrender-animate/fix-fix-bug-of-animation-custom-params_2025-10-31-08-53.json b/common/changes/@visactor/vrender-animate/fix-fix-bug-of-animation-custom-params_2025-10-31-08-53.json new file mode 100644 index 000000000..e827390ae --- /dev/null +++ b/common/changes/@visactor/vrender-animate/fix-fix-bug-of-animation-custom-params_2025-10-31-08-53.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fix the issue of custom animation params\n\n", + "type": "none", + "packageName": "@visactor/vrender-animate" + } + ], + "packageName": "@visactor/vrender-animate", + "email": "lixuef1313@163.com" +} \ No newline at end of file diff --git a/packages/vrender-animate/src/executor/animate-executor.ts b/packages/vrender-animate/src/executor/animate-executor.ts index 7042fff60..ca0e92140 100644 --- a/packages/vrender-animate/src/executor/animate-executor.ts +++ b/packages/vrender-animate/src/executor/animate-executor.ts @@ -424,12 +424,18 @@ export class AnimateExecutor implements IAnimateExecutor { ) { // 处理自定义动画 if (custom && customType) { - const customParams = { + const _customParameters = this.resolveValue(customParameters, graphic); + let customParams = _customParameters; + if (typeof customParams !== 'function') { + customParams = customParams(graphic.context?.data?.[0], graphic, {}); + } + customParams = { width: graphic.stage?.width || 0, height: graphic.stage?.height || 0, group: this._target.parent, - ...this.resolveValue(customParameters, graphic) + ..._customParameters }; + const objOptions = isFunction(options) ? options.call( null,