提交 6caf9fca 编写于 作者: S sushuang

Merge branch 'master' of https://www.github.com/ecomfe/echarts

...@@ -48,9 +48,13 @@ define(function (require) { ...@@ -48,9 +48,13 @@ define(function (require) {
var zr = api.getZr(); var zr = api.getZr();
// Avoid the drag cause ghost shadow // Avoid the drag cause ghost shadow
// FIXME Better way ? // FIXME Better way ?
zr.painter.getLayer(zlevel).clear(true); // SVG doesn't support
var isSvg = zr.painter.getType() === 'svg';
if (!isSvg) {
zr.painter.getLayer(zlevel).clear(true);
}
// Config layer with motion blur // Config layer with motion blur
if (this._lastZlevel != null) { if (this._lastZlevel != null && !isSvg) {
zr.configLayer(this._lastZlevel, { zr.configLayer(this._lastZlevel, {
motionBlur: false motionBlur: false
}); });
...@@ -66,10 +70,12 @@ define(function (require) { ...@@ -66,10 +70,12 @@ define(function (require) {
notInIndividual && console.warn('Lines with trail effect should have an individual zlevel'); notInIndividual && console.warn('Lines with trail effect should have an individual zlevel');
} }
zr.configLayer(zlevel, { if (!isSvg) {
motionBlur: true, zr.configLayer(zlevel, {
lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0) motionBlur: true,
}); lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)
});
}
} }
this.group.add(lineDraw.group); this.group.add(lineDraw.group);
...@@ -83,14 +89,20 @@ define(function (require) { ...@@ -83,14 +89,20 @@ define(function (require) {
this._lineDraw.updateLayout(seriesModel); this._lineDraw.updateLayout(seriesModel);
// Not use motion when dragging or zooming // Not use motion when dragging or zooming
var zr = api.getZr(); var zr = api.getZr();
zr.painter.getLayer(this._lastZlevel).clear(true); var isSvg = zr.painter.getType() === 'svg';
if (!isSvg) {
zr.painter.getLayer(this._lastZlevel).clear(true);
}
}, },
remove: function (ecModel, api) { remove: function (ecModel, api) {
this._lineDraw && this._lineDraw.remove(api, true); this._lineDraw && this._lineDraw.remove(api, true);
// Clear motion when lineDraw is removed // Clear motion when lineDraw is removed
var zr = api.getZr(); var zr = api.getZr();
zr.painter.getLayer(this._lastZlevel).clear(true); var isSvg = zr.painter.getType() === 'svg';
if (!isSvg) {
zr.painter.getLayer(this._lastZlevel).clear(true);
}
}, },
dispose: function () {} dispose: function () {}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册