提交 cb3d8d0c 编写于 作者: K kener

非 ribbonType 动画过渡

上级 ec8f9a81
......@@ -1477,6 +1477,7 @@ define(function (require) {
case 'mark-line' :
ecAnimation.markline(this.zr, oldShape, newShape, duration, easing);
break;
case 'bezier-curve' :
case 'line' :
ecAnimation.line(this.zr, oldShape, newShape, duration, easing);
break;
......
......@@ -96,6 +96,7 @@ define(function (require) {
var newShapeStyle = newShape.style;
if (!oldShape) { // add
oldShape = {
position : newShape.position,
style : {
x : newShapeStyle.x,
y : newShape._orient == 'vertical'
......@@ -113,12 +114,25 @@ define(function (require) {
var newY = newShapeStyle.y;
var newWidth = newShapeStyle.width;
var newHeight = newShapeStyle.height;
var newPosition = [newShape.position[0], newShape.position[1]];
cloneStyle(
newShape, oldShape,
'x', 'y', 'width', 'height'
);
newShape.position = oldShape.position;
zr.addShape(newShape);
if (newPosition[0] != oldShape.position[0] || newPosition[1] != oldShape.position[1]) {
zr.animate(newShape.id, '')
.when(
duration,
{
position: newPosition
}
)
.start(easing);
}
zr.animate(newShape.id, 'style')
.when(
duration,
......@@ -445,6 +459,8 @@ define(function (require) {
if (!oldShape) {
oldShape = {
style : {
xStart : newShape.style.xStart,
yStart : newShape.style.yStart,
xEnd : newShape.style.xStart,
yEnd : newShape.style.yStart
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册