提交 6ee301d2 编写于 作者: K kener

折线填充过渡动画fixed http://www.oschina.net/question/2003065_173244

上级 9e0d58d5
...@@ -917,43 +917,31 @@ define(function (require) { ...@@ -917,43 +917,31 @@ define(function (require) {
// 主线动画 // 主线动画
dx = Math.abs(pointList[0][0] - pointList[1][0]); dx = Math.abs(pointList[0][0] - pointList[1][0]);
dy = Math.abs(pointList[0][1] - pointList[1][1]); dy = Math.abs(pointList[0][1] - pointList[1][1]);
isHorizontal = isHorizontal = this.shapeList[i]._orient === 'horizontal';
this.shapeList[i]._orient === 'horizontal';
if (aniMap[seriesIndex][2]) { if (aniMap[seriesIndex][2]) {
// 队头加入删除末尾 // 队头加入删除末尾
if (this.shapeList[i].type === 'polygon') { if (this.shapeList[i].type === 'half-smooth-polygon') {
//区域图 //区域图
var len = pointList.length; var len = pointList.length;
this.shapeList[i].style.pointList[len - 3] this.shapeList[i].style.pointList[len - 3] = pointList[len - 2];
= pointList[len - 2]; this.shapeList[i].style.pointList[len - 3][isHorizontal ? 0 : 1]
isHorizontal = pointList[len - 4][isHorizontal ? 0 : 1]
? (this.shapeList[i].style.pointList[len - 3][0] this.shapeList[i].style.pointList[len - 2] = pointList[len - 1];
= pointList[len - 4][0]
)
: (this.shapeList[i].style.pointList[len - 3][1]
= pointList[len - 4][1]
);
this.shapeList[i].style.pointList[len - 2]
= pointList[len - 1];
} }
this.shapeList[i].style.pointList.pop(); this.shapeList[i].style.pointList.pop();
isHorizontal ? (x = dx, y = 0) : (x = 0, y = -dy); isHorizontal ? (x = dx, y = 0) : (x = 0, y = -dy);
} }
else { else {
// 队尾加入删除头部 // 队尾加入删除头部
this.shapeList[i].style.pointList.shift(); this.shapeList[i].style.pointList.shift();
if (this.shapeList[i].type === 'polygon') { if (this.shapeList[i].type === 'half-smooth-polygon') {
//区域图 //区域图
var targetPoint = var targetPoint =this.shapeList[i].style.pointList.pop();
this.shapeList[i].style.pointList.pop();
isHorizontal isHorizontal
? (targetPoint[0] = pointList[0][0]) ? (targetPoint[0] = pointList[0][0])
: (targetPoint[1] = pointList[0][1]); : (targetPoint[1] = pointList[0][1]);
this.shapeList[i].style.pointList.push( this.shapeList[i].style.pointList.push(targetPoint);
targetPoint
);
} }
isHorizontal ? (x = -dx, y = 0) : (x = 0, y = dy); isHorizontal ? (x = -dx, y = 0) : (x = 0, y = dy);
} }
...@@ -1049,7 +1037,6 @@ define(function (require) { ...@@ -1049,7 +1037,6 @@ define(function (require) {
n: dy, n: dy,
image: imageLocation image: imageLocation
}); });
} }
else { else {
ctx.moveTo(x, y + dy); ctx.moveTo(x, y + dy);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册