提交 323b9392 编写于 作者: P pissang

refact: upgrade animateTo usage, use cfg object instead.

上级 4fe542cb
......@@ -773,12 +773,12 @@ function updateHoverAnimation(path: PictorialSymbol, symbolMeta: SymbolMeta) {
.on('emphasis', function () {
this.animateTo({
scale: [scale[0] * 1.1, scale[1] * 1.1]
}, 400, 'elasticOut');
}, { duration: 400, easing: 'elasticOut' });
})
.on('normal', function () {
this.animateTo({
scale: scale.slice()
}, 400, 'elasticOut');
}, { duration: 400, easing: 'elasticOut' });
});
}
......
......@@ -358,12 +358,12 @@ function highDownOnUpdate(this: ECSymbol, fromState: DisplayState, toState: Disp
// modify it after support stop specified animation.
// toState === fromState
// ? (this.stopAnimation(), this.attr(emphasisOpt))
this.animateTo(emphasisOpt, 400, 'elasticOut');
this.animateTo(emphasisOpt, { duration: 400, easing: 'elasticOut' });
}
else if (toState === 'normal') {
this.animateTo({
scale: this.__symbolOriginalScale
}, 400, 'elasticOut');
}, { duration: 400, easing: 'elasticOut' });
}
}
......
......@@ -207,7 +207,7 @@ class PiePiece extends graphic.Group {
shape: {
r: layout.r + seriesModel.get('hoverOffset')
}
}, 300, 'elasticOut');
}, { duration: 300, easing: 'elasticOut' });
}
else {
labelLine.ignore = labelLine.normalIgnore;
......@@ -218,7 +218,7 @@ class PiePiece extends graphic.Group {
shape: {
r: layout.r
}
}, 300, 'elasticOut');
}, { duration: 300, easing: 'elasticOut' });
}
}
: null;
......
......@@ -799,8 +799,10 @@ function pointerMoveTo(
pointer.stopAnimation(true);
pointer.animateTo(
{ position: [toCoord, 0] },
pointerModel.get('animationDuration', true),
pointerModel.get('animationEasing', true)
{
duration: pointerModel.get('animationDuration', true),
easing: pointerModel.get('animationEasing', true)
}
);
}
}
......
......@@ -95,7 +95,12 @@ export function createWrap() {
for (let i = 0, len = storage.length; i < len; i++) {
let item = storage[i];
item.el.animateTo(item.target, item.time, item.delay, item.easing, done);
item.el.animateTo(item.target, {
duration: item.time,
delay: item.delay,
easing: item.easing,
done
});
}
return this;
......
......@@ -1042,7 +1042,13 @@ function animateOrSetProps<Props>(
}
duration > 0
? el.animateTo(props, duration, animationDelay || 0, animationEasing, cb, !!cb)
? el.animateTo(props, {
duration,
delay: animationDelay || 0,
easing: animationEasing,
done: cb,
force: !!cb
})
: (el.stopAnimation(), el.attr(props), cb && cb());
}
else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册