提交 f543734d 编写于 作者: P pissang

fix: optimize symbol animation

上级 5e3ed2b2
......@@ -177,20 +177,19 @@ class Symbol extends graphic.Group {
if (isInit) {
const symbolPath = this.childAt(0) as ECSymbol;
const target: PathProps = {
scaleX: this._sizeX,
scaleY: this._sizeY,
style: {
// Always fadeIn. Because it has fadeOut animation when symbol is removed..
opacity: symbolPath.style.opacity
}
};
symbolPath.scaleX = symbolPath.scaleY = 0;
symbolPath.style.opacity = 0;
disableAnimation ? symbolPath.attr(target)
: graphic.initProps(symbolPath, target, seriesModel, idx);
if (!disableAnimation) {
const target: PathProps = {
scaleX: this._sizeX,
scaleY: this._sizeY,
style: {
// Always fadeIn. Because it has fadeOut animation when symbol is removed..
opacity: symbolPath.style.opacity
}
};
symbolPath.scaleX = symbolPath.scaleY = 0;
symbolPath.style.opacity = 0;
graphic.initProps(symbolPath, target, seriesModel, idx);
}
}
this._seriesModel = seriesModel;
......@@ -335,7 +334,6 @@ class Symbol extends graphic.Group {
emphasisState.scaleX = this._sizeX * scaleRatio;
emphasisState.scaleY = this._sizeY * scaleRatio;
}
this.setSymbolScale(1);
enableHoverEmphasis(this, focus, blurScope);
......
......@@ -1008,7 +1008,10 @@ class LineView extends ChartView {
const delay = typeof seriesDalay === 'function' ? seriesDalay(idx)
: (seriesDuration * ratio) + seriesDalayValue;
el.animateFrom({
const symbolPath = el.getSymbolPath();
const text = symbolPath.getTextContent();
symbolPath.animateFrom({
scaleX: 0,
scaleY: 0
}, {
......@@ -1016,8 +1019,6 @@ class LineView extends ChartView {
delay: delay
});
const symbolPath = el.getSymbolPath();
const text = symbolPath.getTextContent();
if (text) {
text.animateFrom({
style: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册