Skip to content

Commit 46c5633

Browse files
authored
Merge pull request #1965 from VisActor/fix/fix-bug-of-animation-custom-params
Fix/fix bug of animation custom params
2 parents b6dab5f + 6b4be8b commit 46c5633

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "fix: fix the issue of custom animation params\n\n",
5+
"type": "none",
6+
"packageName": "@visactor/vrender-animate"
7+
}
8+
],
9+
"packageName": "@visactor/vrender-animate",
10+
"email": "[email protected]"
11+
}

packages/vrender-animate/src/executor/animate-executor.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,12 +424,18 @@ export class AnimateExecutor implements IAnimateExecutor {
424424
) {
425425
// 处理自定义动画
426426
if (custom && customType) {
427-
const customParams = {
427+
const _customParameters = this.resolveValue(customParameters, graphic);
428+
let customParams = _customParameters;
429+
if (typeof customParams !== 'function') {
430+
customParams = customParams(graphic.context?.data?.[0], graphic, {});
431+
}
432+
customParams = {
428433
width: graphic.stage?.width || 0,
429434
height: graphic.stage?.height || 0,
430435
group: this._target.parent,
431-
...this.resolveValue(customParameters, graphic)
436+
..._customParameters
432437
};
438+
433439
const objOptions = isFunction(options)
434440
? options.call(
435441
null,

0 commit comments

Comments
 (0)